mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-25 16:18:55 +01:00
Update check-drives.ps1
This commit is contained in:
parent
669bab0b2e
commit
7172bcadd8
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user