File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,18 @@ $dirs = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm'
1515' C:\Strawberry' , ' C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk'
1616
1717foreach ($dir in $dirs ) {
18- Remove-Item - Recurse - Force - ErrorAction Continue $dir &
18+ Start-ThreadJob - InputObject $dir {
19+ Remove-Item - Recurse - Force - LiteralPath $input
20+ } | Out-Null
1921}
2022
21- # Wait for deletion to finish
22- Get-Job - State Running | Wait-Job
23- # Cleanup finished jobs
24- Get-Job | Remove-Job
23+ foreach ($job in Get-Job ) {
24+ Wait-Job $job | Out-Null
25+ if ($job.Error ) {
26+ Write-Output " ::warning file=$PSCommandPath ::$ ( $job.Error ) "
27+ }
28+ Remove-Job $job
29+ }
2530
2631Get-Volume | Out-String | Write-Output
2732
You can’t perform that action at this time.
0 commit comments