Can't type to console window with Read-Host after PuTTY Plink command
Posted: Tue Dec 10, 2019 11:17 am
Hi all,
I have PuTTY Plink setup between my Windows machine and Linux compute cluster. I've developed a Powershell script that runs Plink commands, then prompts for user input. Unfortunately, after the Plink command is completed, I am no longer able to type anything to the console when the Read-Host prompts for input.
plink -i C:\users\<username>\private_key.ppk <username>@<computername> qstat -a
$returnToMenu = Read-Host -Prompt "Return to main menu? Y/n"
if ($returnToMenu -eq "Y") { mainMenu } else { return }
Please note, it works fine from the ps1 script, but not when the script is packaged as an executable. Any ideas on this?
Thanks!
I have PuTTY Plink setup between my Windows machine and Linux compute cluster. I've developed a Powershell script that runs Plink commands, then prompts for user input. Unfortunately, after the Plink command is completed, I am no longer able to type anything to the console when the Read-Host prompts for input.
plink -i C:\users\<username>\private_key.ppk <username>@<computername> qstat -a
$returnToMenu = Read-Host -Prompt "Return to main menu? Y/n"
if ($returnToMenu -eq "Y") { mainMenu } else { return }
Please note, it works fine from the ps1 script, but not when the script is packaged as an executable. Any ideas on this?
Thanks!