Skip to content

Commit

Permalink
Add -Force flag for proper Hidden File detection in `Invoke-Preproc…
Browse files Browse the repository at this point in the history
…essing.ps1` (ChrisTitusTech#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.
  • Loading branch information
ruxunderscore committed Sep 10, 2024
1 parent 0066875 commit 3145882
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/Invoke-Preprocessing.ps1
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit 3145882

Please sign in to comment.