mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-21 15:33:15 +01:00
Updated ping-host.ps1 and enter-host.ps1
This commit is contained in:
parent
cf34f7dae2
commit
cd3ad88b65
@ -31,7 +31,10 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
& "$PSScriptRoot/ping-host.ps1" $remoteHost
|
& "$PSScriptRoot/ping-host.ps1" $remoteHost
|
||||||
if ($lastExitCode -ne "0") { exit 1 }
|
if ($lastExitCode -ne "0") {
|
||||||
|
Write-Host "Let's try to wake '$remoteHost' up..."
|
||||||
|
& "$PSScriptRoot/wake-up-host.ps1"
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "⏳ Connecting as user '$remoteUser' using " -noNewline
|
Write-Host "⏳ Connecting as user '$remoteUser' using " -noNewline
|
||||||
& ssh -V
|
& ssh -V
|
||||||
|
@ -27,7 +27,7 @@ function GetPingLatency([string]$hostname) {
|
|||||||
try {
|
try {
|
||||||
[int]$latency = GetPingLatency($hostname)
|
[int]$latency = GetPingLatency($hostname)
|
||||||
if ($latency -eq 1500) {
|
if ($latency -eq 1500) {
|
||||||
Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or wake the host up."
|
Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
Write-Host "✅ $hostname is up and running ($($latency)ms latency)."
|
Write-Host "✅ $hostname is up and running ($($latency)ms latency)."
|
||||||
|
Loading…
Reference in New Issue
Block a user