From 314588283a5f2df2f370bd044246d0e06160ac29 Mon Sep 17 00:00:00 2001 From: Rux Date: Tue, 10 Sep 2024 12:28:59 -0700 Subject: [PATCH] Add `-Force` flag for proper Hidden File detection in `Invoke-Preprocessing.ps1` (#2700) * Update Invoke-Preprocessing.ps1 - Added `-Force` argument to Get-ChildItem functions at lines 80 and 90. * Update Invoke-Preprocessing.ps1 - Make changes to new Compile.ps1 file. --- tools/Invoke-Preprocessing.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/Invoke-Preprocessing.ps1 b/tools/Invoke-Preprocessing.ps1 index 96b919d1..090dd178 100644 --- a/tools/Invoke-Preprocessing.ps1 +++ b/tools/Invoke-Preprocessing.ps1 @@ -1,4 +1,4 @@ - function Invoke-Preprocessing { +function Invoke-Preprocessing { <# .SYNOPSIS A function that does Code Formatting using RegEx, useful when trying to force specific coding standard(s) to a project. @@ -92,7 +92,7 @@ $matches = ($filePath) -match '^.*?\*' if ($matches) { - if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File)) { + if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File -Force)) { $failedFilesList += "'$filePath', " } } else { @@ -108,7 +108,7 @@ } # Get Files List - [System.Collections.ArrayList]$files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File + [System.Collections.ArrayList]$files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File -Force $numOfFiles = $files.Count # Only keep the 'FullName' Property for every entry in the list @@ -130,7 +130,7 @@ $matches = ($pathToFind) -match '^.*?\*' if ($matches) { - $filesToCheck = Get-ChildItem -Recurse -Path "$pathToFind" -File + $filesToCheck = Get-ChildItem -Recurse -Path "$pathToFind" -File -Force if ($filesToCheck) { for ($k = 0; $k -lt $filesToCheck.Count; $k++) { $fileToCheck = $filesToCheck[$k]