File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 7
7
Specifies the minimum warning level (10GB by default)
8
8
. EXAMPLE
9
9
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
12
11
. LINK
13
12
https://github.com/fleschutz/PowerShell
14
13
. NOTES
@@ -42,13 +41,13 @@ try {
42
41
$reply += " 📂$name is empty "
43
42
} elseif ($free -eq 0 ) {
44
43
$status = " ⚠️"
45
- $reply += " 📂$name is full ($ ( Bytes2String $total ) ) "
44
+ $reply += " 📂$name with ($ ( Bytes2String $total ) ) is FULL "
46
45
} elseif ($free -lt $minLevel ) {
47
46
$status = " ⚠️"
48
47
$reply += " 📂$name is nearly full ($ ( Bytes2String $free ) of $ ( Bytes2String $total ) left) "
49
48
} 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 ) "
52
51
}
53
52
}
54
53
Write-Host " $status $reply "
You can’t perform that action at this time.
0 commit comments