File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 Specifies the hostname or IP address to ping (x.com by default)
88. EXAMPLE
99 PS> ./ping-host.ps1 x.com
10- ✅ Host 'x.com' at IP 104.244.42.1 is up with 20ms latency.
10+ ✅ Host 'x.com' with 20ms latency at IP 104.244.42.1 is up 👍
1111. LINK
1212 https://github.com/fleschutz/PowerShell
1313. NOTES
2222 [Threading.Tasks.Task ]::WaitAll($tasks )
2323 foreach ($ping in $tasks.Result ) {
2424 if ($ping.Status -eq " Success" ) {
25- Write-Output " ✅ Host '$hostname ' at IP $ ( $ping.Address ) is up with $ ( $ping.RoundtripTime ) ms latency. "
25+ Write-Output " ✅ Host '$hostname ' with $ ( $ping.RoundtripTime ) ms latency at IP $ ( $ping.Address ) is up 👍 "
2626 exit 0 # success
2727 } else {
2828 Write-Output " ⚠️ No reply from '$hostname ' (IP $ ( $ping.Address ) ) - check the connection or maybe the host is down."
You can’t perform that action at this time.
0 commit comments