mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-26 22:51:57 +01:00
Merge branch 'main' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
2e75436637
@ -4588,7 +4588,7 @@ UA,Unit of Action
|
||||
UAAP,University Athletic Association of the Philippines
|
||||
UAB,University of Alabama at Birmingham
|
||||
UAE,United Arab Emirates (also IOC and FIFA trigram,but not ISO 3166)
|
||||
UAP,Unidentified Areal Phenomana
|
||||
UAP,Unidentified Anomalous Phenomena
|
||||
UAR,"Uniformly At Random (probability),Unión Argentina de Rugby (Spanish for "Argentine Rugby Union"),United Arab Republic"
|
||||
UAV,"Unmanned Aerial Vehicle,Unprotected Anal and Vaginal sex,UB[edit]"
|
||||
UBC,"United Baptist Church,University of British Columbia"
|
||||
|
Can't render this file because it has a wrong number of fields in line 8.
|
@ -7,7 +7,7 @@
|
||||
Specifies the hosts to ping, seperated by commata (10 Internet servers by default)
|
||||
.EXAMPLE
|
||||
PS> ./ping-remote-hosts.ps1
|
||||
✅ Online with 0/10 ping loss and 11...40ms latency - 18ms average
|
||||
✅ Online with 11...40ms latency - 18ms average
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -32,11 +32,14 @@ try {
|
||||
if ($latency -gt $max) { $max = $latency }
|
||||
}
|
||||
[int]$loss = $total - $success
|
||||
if ($success -ne 0) {
|
||||
if ($success -eq 0) {
|
||||
Write-Host "⚠️ Offline ($loss/$total ping loss)"
|
||||
} elseif ($loss -eq 0) {
|
||||
$avg /= $success
|
||||
Write-Host "✅ Online with $($min)...$($max)ms latency - $($avg)ms average"
|
||||
} else {
|
||||
$avg /= $success
|
||||
Write-Host "✅ Online with $loss/$total ping loss and $($min)...$($max)ms latency - $($avg)ms average"
|
||||
} else {
|
||||
Write-Host "⚠️ Offline ($loss/$total ping loss)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user