mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-23 23:29:02 +01:00
Improve check-ping.ps1
This commit is contained in:
parent
25dd316328
commit
5e1daeea5d
@ -14,9 +14,14 @@ try {
|
||||
[int]$Max = 0
|
||||
[int]$Avg = 0
|
||||
foreach($Ping in $Pings) {
|
||||
if ($Ping.latency -lt $Min) { $Min = $Ping.latency }
|
||||
if ($Ping.latency -gt $Max) { $Max = $Ping.latency }
|
||||
$Avg += $Ping.latency
|
||||
if ($IsLinux) {
|
||||
[int]$Latency = $Ping.latency
|
||||
} else {
|
||||
[int]$Latency = $Ping.time
|
||||
}
|
||||
if ($Latency -lt $Min) { $Min = $Latency }
|
||||
if ($Latency -gt $Max) { $Max = $Latency }
|
||||
$Avg += $Latency
|
||||
}
|
||||
$Avg = $Avg / $Pings.count
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user