mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-23 23:29:02 +01:00
Update check-drives.ps1
This commit is contained in:
parent
669bab0b2e
commit
7172bcadd8
@ -41,15 +41,15 @@ try {
|
||||
[int64]$Total = ($Used + $Free)
|
||||
|
||||
if ($Total -eq 0) {
|
||||
"✅ Drive $ID is empty"
|
||||
Write-Host "✅ Drive $ID is empty"
|
||||
} elseif ($Free -eq 0) {
|
||||
"⚠️ Drive $ID with $(Bytes2String $Total) is full!"
|
||||
Write-Host "⚠️ Drive $ID with $(Bytes2String $Total) is full!"
|
||||
} 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) {
|
||||
"✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
|
||||
Write-Host "✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
|
||||
} else {
|
||||
"✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) free"
|
||||
Write-Host "✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) free"
|
||||
}
|
||||
}
|
||||
exit 0 # success
|
||||
|
Loading…
Reference in New Issue
Block a user