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'
15
15
' C:\Strawberry' , ' C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk'
16
16
17
17
foreach ($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
19
21
}
20
22
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
+ }
25
30
26
31
Get-Volume | Out-String | Write-Output
27
32
You can’t perform that action at this time.
0 commit comments