File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 9
9
Specifies the minimum level in bytes (10GB by default)
10
10
. EXAMPLE
11
11
PS> ./check-drive-space.ps1 C
12
- ✅ Drive C: uses 56%, 442GB free of 999GB
12
+ ✅ Drive C: uses 56% of 1TB · 442GB free
13
13
. LINK
14
14
https://github.com/fleschutz/PowerShell
15
15
. NOTES
49
49
Write-Host " ⚠️ Drive $driveName with $ ( Bytes2String $total ) is nearly full, $ ( Bytes2String $free ) free"
50
50
} else {
51
51
[int ]$percent = ($used * 100 ) / $total
52
- Write-Host " ✅ Drive $driveName uses $percent %, $ ( Bytes2String $free ) free of $ ( Bytes2String $total ) "
52
+ Write-Host " ✅ Drive $driveName uses $percent % of $ ( Bytes2String $total ) · $ ( Bytes2String $free ) free "
53
53
}
54
54
exit 0 # success
55
55
} catch {
Original file line number Diff line number Diff line change 7
7
. EXAMPLE
8
8
PS> ./install-updates.ps1
9
9
⏳ (1/2) Checking drive space...
10
- ✅ Drive C: uses 56%, 441GB free of 999GB
10
+ ✅ Drive C: uses 56% of 1TB · 441GB free
11
+
11
12
⏳ (2/2) Installing updates from winget and Microsoft Store...
12
13
...
13
14
. LINK
22
23
if ($IsLinux ) {
23
24
" ⏳ (1/5) Checking drive space..."
24
25
& " $PSScriptRoot /check-drive-space.ps1" /
25
-
26
+ " "
26
27
" ⏳ (2/5) Querying latest package information..."
27
28
& sudo apt update
28
29
41
42
} else {
42
43
" ⏳ (1/2) Checking drive space..."
43
44
& " $PSScriptRoot /check-drive-space.ps1" C
44
-
45
+ " "
45
46
" ⏳ (2/2) Installing updates from winget and Microsoft Store..."
46
47
" "
47
48
& winget upgrade -- all -- include- unknown
You can’t perform that action at this time.
0 commit comments