mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-27 09:08:58 +01:00
Merge branch 'master' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
b53e4f5b95
@ -7,8 +7,8 @@
|
||||
Specifies the minimum warning level (10 GB by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-drives.ps1
|
||||
✅ Drive C: at 49%, 512GB free of 1TB
|
||||
✅ Drive D: at 84%, 641GB free of 4TB
|
||||
✅ Drive C: uses 49%, 512GB free of 1TB
|
||||
✅ Drive D: uses 84%, 641GB free of 4TB
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -51,7 +51,7 @@ try {
|
||||
Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
|
||||
} else {
|
||||
[int]$percent = ($used * 100) / $total
|
||||
Write-Host "✅ Drive $name at $percent%, $(Bytes2String $free) free of $(Bytes2String $total)"
|
||||
Write-Host "✅ Drive $name uses $percent%, $(Bytes2String $free) free of $(Bytes2String $total)"
|
||||
}
|
||||
}
|
||||
exit 0 # success
|
||||
|
@ -1,13 +1,13 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the swap space status
|
||||
Checks the swap space
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries the status of the swap space and prints it.
|
||||
This PowerShell script queries the current status of the swap space and prints it.
|
||||
.PARAMETER minLevel
|
||||
Specifies the minimum level in GB (10 GB by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-swap-space.ps1
|
||||
✅ Swap space at 42%, 748MB free of 1GB
|
||||
✅ Swap space uses 42%, 748MB free of 1GB
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -53,7 +53,7 @@ try {
|
||||
Write-Output "✅ Swap space of $(MB2String $Total) reserved"
|
||||
} else {
|
||||
[int]$Percent = ($Used * 100) / $Total
|
||||
Write-Output "✅ Swap space at $Percent%, $(MB2String $Free) free of $(MB2String $Total)"
|
||||
Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $Total)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user