Update check-swap-space.ps1 and ping-local-hosts.ps1

This commit is contained in:
Markus Fleschutz 2024-01-19 16:02:42 +01:00
parent fa91cb5236
commit b56bcbcecd
2 changed files with 5 additions and 5 deletions

View File

@ -49,8 +49,8 @@ try {
Write-Output "⚠️ Swap space of $(MB2String $Total) is full"
} elseif ($Free -lt $minLevel) {
Write-Output "⚠️ Swap space of $(MB2String $Total) is nearly full, only $(MB2String $Free) free"
} elseif ($Used -eq 0) {
Write-Output "✅ Swap space of $(MB2String $Total) reserved"
} elseif ($Used -lt 5) {
Write-Output "✅ Swap space unused, $(MB2String $Free) free"
} else {
[int]$Percent = ($Used * 100) / $Total
Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $Total)"

View File

@ -5,7 +5,7 @@
This PowerShell script pings the computers in the local network and lists which one are up.
.EXAMPLE
PS> ./ping-local-hosts.ps1
Hippo Jenkins01 Jenkins02 Rocket Vega are up.
Up: Hippo Jenkins01 Jenkins02 Rocket Vega
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -42,9 +42,9 @@ try {
$queue.Enqueue($obj)
}
Write-Progress -completed "Done."
Write-Host "$($result)are up."
Write-Host "Up: $($result)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}