Skip to content

Commit 1ada462

Browse files
committed
Update free-disk-space-windows.ps1
1 parent 1414ef7 commit 1ada462

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ci/scripts/free-disk-space-windows.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
$ErrorActionPreference = 'Stop'
44

5+
Write-Output $(Get-Command jq)
6+
57
# Exclude directory from Defender to make this faster
68
Add-MpPreference -ExclusionPath C:\
79

@@ -15,7 +17,13 @@ $dirs = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm'
1517
'C:\Program Files\PostgreSQL', 'C:\Program Files\Unity Hub', 'C:\ProgramData\chocolatey',
1618
'C:\Strawberry', 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk'
1719

18-
Remove-Item -Recurse -Force -ErrorAction Continue $dirs
20+
foreach ($dir in $dirs) {
21+
Remove-Item -Recurse -Force -ErrorAction Continue $dir &
22+
}
23+
24+
Get-Job -State Running | Wait-Job
25+
26+
$saved = ($(Get-Volume C).SizeRemaining - $available) / 1gb
27+
Write-Output "total space saved $saved GB"
1928

20-
$saved = ($available - $(Get-Volume C).SizeRemaining) / 1gb
21-
Write-Host "total space saved $saved GB"
29+
Write-Output $(Get-Command jq)

0 commit comments

Comments
 (0)