I have a Powershell script that will automatically SSH to a Linux host (ESXI Server running Busybox) and will run a singular command (./my_script.sh
), which captures some network traffic on the ESXI server. However, this script waits for user input (CTRL + C) to exit the script.
I have tried using the Posh-SSH module (Invoke-SSHCommand -SSHSession $session -Command $command
) syntax as well as the Plink module (plink -batch *servername* -pw *userPassword* *command*
) but the commands always execute and return me back to the shell, they never wait for user interaction.
Of course, if I run it directly on the ESXI server the script will wait for the CTRL + C command to terminate.
Does anybody know of a workaround for this?