Skip to content

Commit 8aa468f

Browse files
author
Markus Fleschutz
committed
Updated check-drives.ps1
1 parent f0272d1 commit 8aa468f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/check-drives.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
Specifies the minimum warning level (10GB by default)
88
.EXAMPLE
99
PS> ./check-drives.ps1
10-
✅ C: at 49% of 1TB - 512GB free
11-
✅ D: at 84% of 4TB - 641GB free
10+
✅ 📂C: has 432GB of 930GB left (54% full) 📂D: has 507GB of 4TB left (86% full) 📂E: is empty
1211
.LINK
1312
https://github.com/fleschutz/PowerShell
1413
.NOTES
@@ -42,13 +41,13 @@ try {
4241
$reply += "📂$name is empty "
4342
} elseif ($free -eq 0) {
4443
$status = "⚠️"
45-
$reply += "📂$name is full ($(Bytes2String $total)) "
44+
$reply += "📂$name with ($(Bytes2String $total)) is FULL "
4645
} elseif ($free -lt $minLevel) {
4746
$status = "⚠️"
4847
$reply += "📂$name is nearly full ($(Bytes2String $free) of $(Bytes2String $total) left) "
4948
} else {
50-
[int64]$percent = ($free * 100) / $total
51-
$reply += "📂$name has $(Bytes2String $free) of $(Bytes2String $total) left ($percent%) "
49+
[int64]$percent = ($used * 100) / $total
50+
$reply += "📂$name has $(Bytes2String $free) of $(Bytes2String $total) left ($percent% full) "
5251
}
5352
}
5453
Write-Host "$status $reply"

0 commit comments

Comments
 (0)