From 75c47725c4186e1b0fbd4c237aee33034cd82cf2 Mon Sep 17 00:00:00 2001 From: ruxunderscore Date: Sun, 8 Sep 2024 23:27:20 +0000 Subject: [PATCH] Add flag to properly detect hidden files, like and , to prevent errors with the script. --- tools/Invoke-Preprocessing.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Invoke-Preprocessing.ps1 b/tools/Invoke-Preprocessing.ps1 index c9692fc68..adfd738b5 100644 --- a/tools/Invoke-Preprocessing.ps1 +++ b/tools/Invoke-Preprocessing.ps1 @@ -77,7 +77,7 @@ for ($i = 0; $i -lt $count; $i++) { $excludedFile = $ExcludedFiles[$i] $filePath = "$(($WorkingDir -replace ('\\$', '')) + '\' + ($excludedFile -replace ('\.\\', '')))" - if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File)) { + if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File -Force)) { $failedFilesList += "'$filePath', " } } @@ -87,7 +87,8 @@ } } - $files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File + $files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File -Force + $numOfFiles = $files.Count if ($numOfFiles -eq 0) {