@@ -952,7 +952,7 @@ function Find-Item {
952952 else {
953953 # output relative path of the found item
954954 Microsoft.PowerShell.Utility\Write-Information " Resolving relative path with base: $relativeBasePath "
955- $rp = Microsoft.PowerShell.Management\Resolve-Path - LiteralPath:($itemInfo.FullName ) - Relative - RelativeBasePath:$relativeBasePath
955+ $rp = Microsoft.PowerShell.Management\Resolve-Path - LiteralPath: ($itemInfo.FullName ) - Relative - RelativeBasePath:$relativeBasePath
956956 Microsoft.PowerShell.Utility\Write-Verbose " Microsoft.PowerShell.Management\Resolve-Path -LiteralPath '$ ( $itemInfo.FullName ) ' -Relative -RelativeBasePath:'$relativeBasePath '"
957957
958958 Microsoft.PowerShell.Utility\Write-Information " Relative path: $rp "
@@ -1075,63 +1075,63 @@ function Find-Item {
10751075
10761076 Microsoft.PowerShell.Utility\Write-Information " Directory stack processing complete - processed $stackProcessCount items"
10771077 Microsoft.PowerShell.Utility\Write-Verbose " Search complete: Examined $totalDirsProcessed directories and $totalFilesChecked files, found $totalMatches matches"
1078- }
1078+ }
10791079
1080- # process each search mask provided
1081- foreach ($currentSearchPhrase in $using :SearchMask ) {
1080+ # process each search mask provided
1081+ foreach ($currentSearchPhrase in $using :SearchMask ) {
10821082
1083- Microsoft.PowerShell.Utility\Write-Information " Processing search pattern: $currentSearchPhrase "
1084- Microsoft.PowerShell.Utility\Write-Verbose " Processing search pattern: $currentSearchPhrase "
1083+ Microsoft.PowerShell.Utility\Write-Information " Processing search pattern: $currentSearchPhrase "
1084+ Microsoft.PowerShell.Utility\Write-Verbose " Processing search pattern: $currentSearchPhrase "
10851085
1086- $expandedSearchMask = GenXdev.FileSystem\Expand-Path $currentSearchPhrase
1086+ $expandedSearchMask = GenXdev.FileSystem\Expand-Path $currentSearchPhrase
10871087
1088- # Check if this specific search mask should include alternate data streams
1089- # Simplified to only check the expanded search mask
1090- $hasStreamPattern = $null -ne $streamPatterns [$expandedSearchMask ]
1091- $includeAds = $includeAlternateFileStreams -or $hasStreamPattern
1088+ # Check if this specific search mask should include alternate data streams
1089+ # Simplified to only check the expanded search mask
1090+ $hasStreamPattern = $null -ne $streamPatterns [$expandedSearchMask ]
1091+ $includeAds = $includeAlternateFileStreams -or $hasStreamPattern
10921092
1093- if ($includeAds ) {
1094- Microsoft.PowerShell.Utility\Write-Information " This search mask should include ADS: $currentSearchPhrase "
1095- }
1093+ if ($includeAds ) {
1094+ Microsoft.PowerShell.Utility\Write-Information " This search mask should include ADS: $currentSearchPhrase "
1095+ }
10961096
1097- # if not a multi-drive search or currently processing root context
1098- if ($null -eq $PSItem ) {
1099-
1100- Microsoft.PowerShell.Utility\Write-Information ' Searching in current context (not drive-specific)'
1101- Search-DirectoryContent - SearchPhrase $currentSearchPhrase `
1102- - IncludeAds $includeAds `
1103- - HasStreamPattern $hasStreamPattern `
1104- - ExpandedSearchMask $expandedSearchMask `
1105- - StreamPatterns $streamPatterns `
1106- - PassThru $using :PassThru `
1107- - RelativeBasePath $using :RelativeBasePath `
1108- - Pattern $using :Pattern `
1109- - Directory $using :Directory `
1110- - FilesAndDirectories $using :FilesAndDirectories `
1111- - NoRecurse $using :NoRecurse
1112- }
1113- else {
1114- $expandedSearchMask = GenXdev.FileSystem\Expand-Path $currentSearchPhrase `
1115- - ForceDrive $PSItem.Name
1116- # force the search to start from the specific drive
1117- Microsoft.PowerShell.Utility\Write-Information " Searching on drive $ ( $PSItem.Name ) "
1118- Microsoft.PowerShell.Utility\Write-Verbose " Searching on drive $ ( $PSItem.Name ) "
1119- Microsoft.PowerShell.Utility\Write-Information " Expanded path for drive $ ( $PSItem.Name ) : $expandedSearchMask "
1120-
1121- Search-DirectoryContent - SearchPhrase $expandedSearchMask `
1122- - IncludeAds $includeAds `
1123- - HasStreamPattern $hasStreamPattern `
1124- - ExpandedSearchMask $expandedSearchMask `
1125- - StreamPatterns $streamPatterns `
1126- - PassThru $using :PassThru `
1127- - RelativeBasePath $using :RelativeBasePath `
1128- - Pattern $using :Pattern `
1129- - Directory $using :Directory `
1130- - FilesAndDirectories $using :FilesAndDirectories `
1131- - NoRecurse $using :NoRecurse
1132- }
1097+ # if not a multi-drive search or currently processing root context
1098+ if ($null -eq $PSItem ) {
1099+
1100+ Microsoft.PowerShell.Utility\Write-Information ' Searching in current context (not drive-specific)'
1101+ Search-DirectoryContent - SearchPhrase $currentSearchPhrase `
1102+ - IncludeAds $includeAds `
1103+ - HasStreamPattern $hasStreamPattern `
1104+ - ExpandedSearchMask $expandedSearchMask `
1105+ - StreamPatterns $streamPatterns `
1106+ - PassThru $using :PassThru `
1107+ - RelativeBasePath $using :RelativeBasePath `
1108+ - Pattern $using :Pattern `
1109+ - Directory $using :Directory `
1110+ - FilesAndDirectories $using :FilesAndDirectories `
1111+ - NoRecurse $using :NoRecurse
1112+ }
1113+ else {
1114+ $expandedSearchMask = GenXdev.FileSystem\Expand-Path $currentSearchPhrase `
1115+ - ForceDrive $PSItem.Name
1116+ # force the search to start from the specific drive
1117+ Microsoft.PowerShell.Utility\Write-Information " Searching on drive $ ( $PSItem.Name ) "
1118+ Microsoft.PowerShell.Utility\Write-Verbose " Searching on drive $ ( $PSItem.Name ) "
1119+ Microsoft.PowerShell.Utility\Write-Information " Expanded path for drive $ ( $PSItem.Name ) : $expandedSearchMask "
1120+
1121+ Search-DirectoryContent - SearchPhrase $expandedSearchMask `
1122+ - IncludeAds $includeAds `
1123+ - HasStreamPattern $hasStreamPattern `
1124+ - ExpandedSearchMask $expandedSearchMask `
1125+ - StreamPatterns $streamPatterns `
1126+ - PassThru $using :PassThru `
1127+ - RelativeBasePath $using :RelativeBasePath `
1128+ - Pattern $using :Pattern `
1129+ - Directory $using :Directory `
1130+ - FilesAndDirectories $using :FilesAndDirectories `
1131+ - NoRecurse $using :NoRecurse
11331132 }
11341133 }
1134+ }
11351135
11361136 Microsoft.PowerShell.Utility\Write-Information ' PROCESS Find-Item: Search processing completed'
11371137 Microsoft.PowerShell.Utility\Write-Verbose ' Search completed'
0 commit comments