mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-05 05:29:24 +01:00
Updated ping-host.ps1
This commit is contained in:
parent
7841c95ad7
commit
1a0daf2109
@ -24,9 +24,12 @@ try {
|
||||
if ($ping.Status -eq "Success") {
|
||||
Write-Output "✅ Host '$hostname' at IP $($ping.Address) is up with $($ping.RoundtripTime)ms latency."
|
||||
exit 0 # success
|
||||
} else {
|
||||
Write-Output "⚠️ No reply from '$hostname' (IP $($ping.Address)) - check the connection or maybe the host is down."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Write-Output "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down."
|
||||
Write-Output "⚠️ No reply from host '$hostname' - check the connection or maybe the host is down."
|
||||
exit 1
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user