mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Update check-ping.ps1
This commit is contained in:
parent
30d1fc6a37
commit
5db15b88df
@ -3,7 +3,7 @@
|
|||||||
check-ping.ps1 [<hosts>]
|
check-ping.ps1 [<hosts>]
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Checks the ping latency from the local computer to Internet hosts.
|
Checks the ping latency from the local computer to Internet hosts.
|
||||||
(default is: 'amazon.com,bing.com,cnn.com dropbox.com,ebay.com,facebook.com,google.com,youtube.com)
|
(default is: 'amazon.com,apple.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> .\check-ping.ps1
|
PS> .\check-ping.ps1
|
||||||
.LINK
|
.LINK
|
||||||
@ -12,7 +12,7 @@
|
|||||||
Author: Markus Fleschutz · License: CC0
|
Author: Markus Fleschutz · License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$hosts = "amazon.com,bing.com,cnn.com,dropbox.com,ebay.com,facebook.com,google.com,youtube.com")
|
param([string]$hosts = "amazon.com,apple.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
write-progress "Sending pings to $hosts..."
|
write-progress "Sending pings to $hosts..."
|
||||||
@ -34,7 +34,7 @@ try {
|
|||||||
}
|
}
|
||||||
$Avg = $Avg / $Pings.count
|
$Avg = $Avg / $Pings.count
|
||||||
|
|
||||||
"✔️ $Avg ms average ping latency ($Min ms min, $Max ms max)"
|
"✔️ $Avg ms net latency average ($Min ms min, $Max ms max, $($Pings.count) hosts)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user