File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 "
You can’t perform that action at this time.
0 commit comments