mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-15 17:36:48 +02:00
Update check-ping.ps1
This commit is contained in:
parent
6e093e7dee
commit
22b72f2071
@ -2,12 +2,12 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks the ping latency
|
Checks the ping latency
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script measures the ping roundtrip times from the local computer to other computers (10 Internet servers by default).
|
This PowerShell script measures the ping roundtrip times from the local computer to other ones (10 Internet servers by default).
|
||||||
.PARAMETER hosts
|
.PARAMETER hosts
|
||||||
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 ping, seperated by commata (10 Internet servers by default)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-ping.ps1
|
PS> ./check-ping.ps1
|
||||||
✅ Online with 18ms latency average (13ms...109ms, 0/10 ping loss)
|
✅ Online with 18ms latency (13ms...109ms, 0/10 ping loss)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -36,7 +36,7 @@ try {
|
|||||||
[int]$loss = $total - $success
|
[int]$loss = $total - $success
|
||||||
if ($success -ne 0) {
|
if ($success -ne 0) {
|
||||||
$avg /= $success
|
$avg /= $success
|
||||||
Write-Host "✅ Online with $($avg)ms latency average ($($min)ms...$($max)ms, $loss/$total ping loss)"
|
Write-Host "✅ Online with $($avg)ms latency ($($min)ms...$($max)ms, $loss/$total ping loss)"
|
||||||
} else {
|
} else {
|
||||||
Write-Host "⚠️ Offline ($loss/$total ping loss)"
|
Write-Host "⚠️ Offline ($loss/$total ping loss)"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user