Fix generate-checksums.ps1 bug

This commit is contained in:
DSR! committed 2024-06-17 01:54:34 -03:00
1 parent 4f47da9871
commit fc19a28cda
1 file changed
+1 -1
+1 -1
View File
@@ -28,7 +28,7 @@ $fullDirectoryPath = (Get-Item -Path $Directory).FullName
$searchOption = $NoRecurse ? [System.IO.SearchOption]::TopDirectoryOnly : [System.IO.SearchOption]::AllDirectories
# Iterate over each file in the directory matching the pattern
Get-ChildItem -Path $Directory -Filter $FilePattern -File -Recurse: -not $NoRecurse | ForEach-Object {
Get-ChildItem -Path $Directory -Filter $FilePattern -File -Recurse:$searchOption | ForEach-Object {
$fileHash = Get-FileHashSHA256 -filePath $_.FullName
$relativePath = $_.FullName.Substring($fullDirectoryPath.Length + 1).TrimStart('\')
$hashResults.Add("$fileHash .\$relativePath")