File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 6
6
. PARAMETER MinLevel
7
7
Specifies the minimum warning level (10 GB by default)
8
8
. EXAMPLE
9
- PS> ./check-drives
10
- ✅ Drive C: with 250GB is 10% full , 225GB free
9
+ PS> ./check-drives.ps1
10
+ ✅ Drive C: with 250GB at 10%, 225GB free
11
11
. LINK
12
12
https://github.com/fleschutz/PowerShell
13
13
. NOTES
51
51
Write-Host " ⚠️ Drive $ID with $ ( Bytes2String $Total ) is nearly full, $ ( Bytes2String $Free ) free"
52
52
} else {
53
53
[int ]$Percent = ($Used * 100 ) / $Total
54
- Write-Host " ✅ Drive $ID with $ ( Bytes2String $Total ) is $Percent % full, $ ( Bytes2String $Free ) free"
54
+ if ($Percent -gt 90 ) {
55
+ Write-Host " ✅ Drive $ID with $ ( Bytes2String $Total ) is $Percent % full, $ ( Bytes2String $Free ) free"
56
+ } else {
57
+ Write-Host " ✅ Drive $ID with $ ( Bytes2String $Total ) at $Percent %, $ ( Bytes2String $Free ) free"
58
+ }
55
59
}
56
60
}
57
61
exit 0 # success
You can’t perform that action at this time.
0 commit comments