File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 7
7
Specifies the minimum level (10 GB by default)
8
8
. EXAMPLE
9
9
PS> ./check-swap-space.ps1
10
- ✅ Swap space uses 122MB ( 10%) of 1GB
10
+ ✅ Swap space 10% full, 901MB of 1TB free
11
11
. LINK
12
12
https://github.com/fleschutz/PowerShell
13
13
. NOTES
51
51
Write-Output " ⚠️ Swap space of $ ( MB2String $Total ) is nearly full ($ ( MB2String $Free ) free)"
52
52
} elseif ($Used -eq 0 ) {
53
53
Write-Output " ✅ Swap space with $ ( MB2String $Total ) reserved"
54
- } elseif ($Used -lt $Free ) {
55
- [int ]$Percent = ($Used * 100 ) / $Total
56
- Write-Output " ✅ Swap space uses $ ( MB2String $Used ) ($ ( $Percent ) %) of $ ( MB2String $Total ) "
57
54
} else {
58
- Write-Output " ✅ Swap space has $ ( MB2String $Free ) of $ ( MB2String $Total ) free"
55
+ [int ]$Percent = ($Used * 100 ) / $Total
56
+ Write-Output " ✅ Swap space $Percent % full, $ ( MB2String $Free ) of $ ( MB2String $Total ) free"
59
57
}
60
58
exit 0 # success
61
59
} catch {
You can’t perform that action at this time.
0 commit comments