mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 17:38:19 +02:00
Update check-ping.ps1
This commit is contained in:
parent
3347acc028
commit
a6936f6726
@ -7,7 +7,7 @@
|
|||||||
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,github.com,google.com,live.com,meta.com,x.com,youtube.com)
|
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,github.com,google.com,live.com,meta.com,x.com,youtube.com)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-ping.ps1
|
PS> ./check-ping.ps1
|
||||||
✅ Ping latency is 29ms average (13ms...109ms, 0/10 loss)
|
✅ Online with 18ms latency average (13ms...109ms, 0/10 ping loss)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -38,9 +38,9 @@ try {
|
|||||||
}
|
}
|
||||||
if ($successCount -ne 0) {
|
if ($successCount -ne 0) {
|
||||||
$avg /= $successCount
|
$avg /= $successCount
|
||||||
Write-Host "✅ Online with $($avg)ms ping latency ($($min)ms...$($max)ms, $lossCount/$totalCount loss)"
|
Write-Host "✅ Online with $($avg)ms latency average ($($min)ms...$($max)ms, $lossCount/$totalCount ping loss)"
|
||||||
} else {
|
} else {
|
||||||
Write-Host "⚠️ Offline ($lossCount/$totalCount loss)"
|
Write-Host "⚠️ Offline ($lossCount/$totalCount ping loss)"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user