Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Force flag for proper Hidden File detection in Invoke-Preprocessing.ps1 #2700

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading