diff --git a/scripts/enter.ps1 b/scripts/enter-host.ps1 similarity index 76% rename from scripts/enter.ps1 rename to scripts/enter-host.ps1 index 9241dc07..c4dccebc 100755 --- a/scripts/enter.ps1 +++ b/scripts/enter-host.ps1 @@ -1,12 +1,14 @@ <# .SYNOPSIS - Login to another host via SSH + Enter another host via SSH .DESCRIPTION This PowerShell script logs into a remote host via secure shell (SSH). .PARAMETER remoteHost Specifies the remote hostname or IP address .EXAMPLE - PS> ./enter.ps1 linuxhost + PS> ./enter-host.ps1 tux + Entering 💻tux as user 'markus' using OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 + ... .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -20,12 +22,11 @@ try { if ($IsLinux) { $username = $(whoami) } else { $username = $env:USERNAME } $username = $username.toLower() - Write-Host "Trying to enter 💻$remoteHost as user '$username' using " -noNewline + Write-Host "Entering 💻$remoteHost as user '$username' using " -noNewline & ssh -V if ($lastExitCode -ne "0") { throw "'ssh -V' failed with exit code $lastExitCode" } & ssh "$($username)@$($remoteHost)" - if ($lastExitCode -ne "0") { throw "'ssh -V' failed with exit code $lastExitCode" } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/wake-up.ps1 b/scripts/wake-up-host.ps1 similarity index 97% rename from scripts/wake-up.ps1 rename to scripts/wake-up-host.ps1 index ba1d7bd8..27601f64 100755 --- a/scripts/wake-up.ps1 +++ b/scripts/wake-up-host.ps1 @@ -12,7 +12,7 @@ .PARAMETER numTimes Specifies # of times to send the packet (3 by default) .EXAMPLE - PS> ./wake-up.ps1 11:22:33:44:55:66 192.168.100.100 + PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.100 ✅ Magic packet sent to IP 192.168.100.100, UDP port 9, 3x - wait a minute until the computer fully boots up. .LINK https://github.com/fleschutz/PowerShell