1) Set the PowerShell Window Title to something specific:
$host.ui.RawUI.WindowTitle = "Your Title"
2) Save a script called say “SendPassword.ps1” with the below content to somewhere accessible (I’ll use 'C:\MY TOOLS' in this post):
$wshell = New-Object -ComObject wscript.shell;
Note: You will need to tune the sleep timer so that it finishes after the ‘Password’ prompt appears. 4 seconds worked for me in the example below.
3) Run your SSH command from PowerShell like below:
start powershell.exe '.\SendPassword.ps1' -WorkingDirectory 'C:\MY TOOLS'; ssh.exe firstname.lastname@example.org node show local -fields serialnumber
Image: Screenshot of the setup
Post a Comment