mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-15 14:38:17 +02:00
Updated enter-host.ps1 and ping-host.ps1
This commit is contained in:
parent
c37bf0e1e1
commit
a21e7542a7
@ -7,7 +7,7 @@
|
||||
Specifies the remote hostname or IP address
|
||||
.EXAMPLE
|
||||
PS> ./enter-host.ps1 tux
|
||||
✅ tux is up and running (3ms latency).
|
||||
✅ tux is online (3ms latency to 192.168.1.179)
|
||||
⏳ Connecting as user 'markus' using OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
|
||||
markus@tux's password:
|
||||
...
|
||||
|
@ -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 up and running 👍 (20ms to IP 104.244.42.1)
|
||||
✅ 'x.com' is online (20ms 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 up and running 👍 ($($ping.RoundtripTime / 2)ms to IP $($ping.Address))"
|
||||
Write-Output "✅ '$hostname' is online ($($ping.RoundtripTime / 2)ms 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."
|
||||
|
Loading…
Reference in New Issue
Block a user