Skip to content

Commit 649b804

Browse files
committed
Use .NET
1 parent d6615a6 commit 649b804

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

extensions/powershell/powershell-discover.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ $m = [System.Collections.Concurrent.ConcurrentBag[hashtable]]::new()
44

55
$psPaths | ForEach-Object -Parallel {
66
$queue = $using:m
7-
$files = Get-ChildItem -Path $_ -Recurse -File -Filter '*.dsc.resource.*' -ErrorAction Ignore |
8-
Where-Object -Property Extension -In @('.json', '.yaml', '.yml')
9-
10-
foreach ($file in $files) {
11-
$queue.Add(@{ manifestPath = $file.FullName })
7+
$searchPatterns = @('*.dsc.resource.json', '*.dsc.resource.yaml', '*.dsc.resource.yml')
8+
foreach ($pattern in $searchPatterns) {
9+
try {
10+
[System.IO.Directory]::EnumerateFiles($_, $pattern, 'AllDirectories') | ForEach-Object {
11+
$queue.Add(@{ manifestPath = $_ })
12+
}
13+
} catch { }
1214
}
13-
} -ThrottleLimit 10
15+
} -ThrottleLimit 30
1416

15-
@($m) | ConvertTo-Json -Compress
17+
[array]$m | ConvertTo-Json -Compress

0 commit comments

Comments
 (0)