Update check-ping.ps1

This commit is contained in:
Markus Fleschutz 2023-01-02 16:28:13 +01:00
parent 4dc53f4cf7
commit fcbd5a45c1

View File

@ -7,7 +7,7 @@
Specifies the hosts to check, seperated by comma (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com) Specifies the hosts to check, seperated by comma (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
.EXAMPLE .EXAMPLE
PS> ./check-ping PS> ./check-ping
Ping is 25ms average, 13ms min, 109ms max Ping is 13ms min, 109ms max, and 25ms average.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -32,8 +32,8 @@ try {
} }
$Avg /= $Pings.count $Avg /= $Pings.count
Write-Host "✅ Ping is $($Avg)ms average, $($Min)ms min, $($Max)ms max" Write-Host "✅ Ping is $($Min)ms min, $($Max)ms max, and $($Avg)ms average."
Write-Progress -Completed " " Write-Progress -Completed " "
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"