Updated ping-host.ps1

This commit is contained in:
Markus Fleschutz
2025-07-14 18:39:28 +02:00
parent e936a1ef6a
commit 44b6e724e3

View File

@ -7,7 +7,7 @@
Specifies the hostname or IP address to ping (x.com by default)
.EXAMPLE
PS> ./ping-host.ps1 x.com
✅ 'x.com' is online (20ms to IP 104.244.42.1)
✅ 'x.com' is online (20ms ping to IP 104.244.42.1)
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -22,7 +22,7 @@ try {
[Threading.Tasks.Task]::WaitAll($tasks)
foreach($ping in $tasks.Result) {
if ($ping.Status -eq "Success") {
Write-Output "✅ '$hostname' is online ($($ping.RoundtripTime / 2)ms to IP $($ping.Address))"
Write-Output "✅ '$hostname' is online ($($ping.RoundtripTime / 2)ms ping to IP $($ping.Address))"
exit 0 # success
} else {
Write-Output "⚠️ No reply from '$hostname' (IP $($ping.Address)) - check the connection or maybe the host is down."