Update check-drives.ps1

This commit is contained in:
Markus Fleschutz 2022-12-28 18:30:28 +01:00
parent 669bab0b2e
commit 7172bcadd8

View File

@ -41,15 +41,15 @@ try {
[int64]$Total = ($Used + $Free) [int64]$Total = ($Used + $Free)
if ($Total -eq 0) { if ($Total -eq 0) {
"✅ Drive $ID is empty" Write-Host "✅ Drive $ID is empty"
} elseif ($Free -eq 0) { } elseif ($Free -eq 0) {
"⚠️ Drive $ID with $(Bytes2String $Total) is full!" Write-Host "⚠️ Drive $ID with $(Bytes2String $Total) is full!"
} elseif ($Free -lt $MinLevel) { } elseif ($Free -lt $MinLevel) {
"⚠️ Drive $ID with $(Bytes2String $Total) is nearly full ($(Bytes2String $Free) free)!" Write-Host "⚠️ Drive $ID with $(Bytes2String $Total) is nearly full ($(Bytes2String $Free) free)!"
} elseif ($Used -lt $Free) { } elseif ($Used -lt $Free) {
"✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)" Write-Host "✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
} else { } else {
"✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) free" Write-Host "✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) free"
} }
} }
exit 0 # success exit 0 # success