mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +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"
|
Write-Output "⚠️ Swap space of $(MB2String $Total) is full"
|
||||||
} elseif ($Free -lt $minLevel) {
|
} elseif ($Free -lt $minLevel) {
|
||||||
Write-Output "⚠️ Swap space of $(MB2String $Total) is nearly full, only $(MB2String $Free) free"
|
Write-Output "⚠️ Swap space of $(MB2String $Total) is nearly full, only $(MB2String $Free) free"
|
||||||
} elseif ($Used -eq 0) {
|
} elseif ($Used -lt 5) {
|
||||||
Write-Output "✅ Swap space of $(MB2String $Total) reserved"
|
Write-Output "✅ Swap space unused, $(MB2String $Free) free"
|
||||||
} else {
|
} else {
|
||||||
[int]$Percent = ($Used * 100) / $Total
|
[int]$Percent = ($Used * 100) / $Total
|
||||||
Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $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.
|
This PowerShell script pings the computers in the local network and lists which one are up.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./ping-local-hosts.ps1
|
PS> ./ping-local-hosts.ps1
|
||||||
✅ Hippo Jenkins01 Jenkins02 Rocket Vega are up.
|
✅ Up: Hippo Jenkins01 Jenkins02 Rocket Vega
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -42,9 +42,9 @@ try {
|
|||||||
$queue.Enqueue($obj)
|
$queue.Enqueue($obj)
|
||||||
}
|
}
|
||||||
Write-Progress -completed "Done."
|
Write-Progress -completed "Done."
|
||||||
Write-Host "✅ $($result)are up."
|
Write-Host "✅ Up: $($result)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user