mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-18 10:56:45 +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
|
Specifies the remote hostname or IP address
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./enter-host.ps1 tux
|
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
|
⏳ Connecting as user 'markus' using OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
|
||||||
markus@tux's password:
|
markus@tux's password:
|
||||||
...
|
...
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Specifies the hostname or IP address to ping (x.com by default)
|
Specifies the hostname or IP address to ping (x.com by default)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./ping-host.ps1 x.com
|
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
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -22,7 +22,7 @@ try {
|
|||||||
[Threading.Tasks.Task]::WaitAll($tasks)
|
[Threading.Tasks.Task]::WaitAll($tasks)
|
||||||
foreach($ping in $tasks.Result) {
|
foreach($ping in $tasks.Result) {
|
||||||
if ($ping.Status -eq "Success") {
|
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
|
exit 0 # success
|
||||||
} else {
|
} else {
|
||||||
Write-Output "⚠️ No reply from '$hostname' (IP $($ping.Address)) - check the connection or maybe the host is down."
|
Write-Output "⚠️ No reply from '$hostname' (IP $($ping.Address)) - check the connection or maybe the host is down."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user