mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 07:53:21 +01:00
Update check-swap-space.ps1 and ping-local-hosts.ps1
This commit is contained in:
parent
fa91cb5236
commit
b56bcbcecd
@ -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)"
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user