mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-27 09:08:58 +01:00
Update check-ping.ps1
This commit is contained in:
parent
7f31a3b98b
commit
aa7ae2fff1
@ -7,7 +7,7 @@
|
||||
PS> ./check-network.ps1
|
||||
|
||||
N E T W O R K
|
||||
✅ Firewall enabled
|
||||
✅ Online with 30ms latency (16ms..56ms, 0/10 loss)
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
@ -17,8 +17,8 @@
|
||||
|
||||
" "
|
||||
& "$PSScriptRoot/write-green.ps1" " N E T W O R K"
|
||||
& "$PSScriptRoot/check-firewall"
|
||||
& "$PSScriptRoot/check-ping.ps1"
|
||||
& "$PSScriptRoot/check-firewall"
|
||||
& "$PSScriptRoot/check-dns.ps1"
|
||||
& "$PSScriptRoot/check-vpn.ps1"
|
||||
& "$PSScriptRoot/list-public-ip.ps1"
|
||||
|
@ -36,11 +36,11 @@ try {
|
||||
$lossCount++
|
||||
}
|
||||
}
|
||||
if ($successCount -eq 0) {
|
||||
Write-Host "⚠️ Offline ($lossCount/$totalCount loss)"
|
||||
} else {
|
||||
if ($successCount -ne 0) {
|
||||
$avg /= $successCount
|
||||
Write-Host "✅ Ping latency is $($avg)ms average ($($min)ms...$($max)ms, $lossCount/$totalCount loss)"
|
||||
Write-Host "✅ Online with $($avg)ms ping latency ($($min)ms...$($max)ms, $lossCount/$totalCount loss)"
|
||||
} else {
|
||||
Write-Host "⚠️ Offline ($lossCount/$totalCount loss)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user