4

I have a powershell script based on This which displays a form with IP addresses and ping results. I've heavily modified it as I use it for switches and routers. My modification form allows me to double click on a cell to run a cmd file to run a putty command to SSH to the machine

However what I find is that the powershell scripts suspends until I exit putty. In attempt to resolve this I made the command in side the power shell script this

.\ssh.cmd $user $computer

The SSH.CMD file contains the following

start "%2" "c:\Program Files (x86)\Putty\putty.exe" -l %1 %2

Yes the form still suspends until I exit putty. I have got the direct putty command working

. "c:\Program Files (x86)\Putty\putty.exe" -l $user $computer

and this does not suspend - however I'd like to know why the running of start suspends the powershell form.

4
  • 1
    If you get a change, play with ss64.com/ps/start-process.html and see if it has the same behavior. Not sure if the /B switch with the start command would help or not but easy enough to test I would think (ss64.com/nt/start.html). Oct 19, 2017 at 13:37
  • Any particular reason you're reaching out from your PS script to a batch script? I don't suspect you'd have this issue if you called Putty and some parameters with the Start-Process cmdlet.
    – root
    Oct 19, 2017 at 14:54
  • Legacy CMD files , as I don't want to have to rewrite them all straight away. In this case I've already got Reid of this one
    – Ross
    Oct 19, 2017 at 20:19
  • Finally back from travel and yes Start-Process .\ssh.cmd "$user $computer $password" does not suspend - so I can run cmd/batch files if needed now Thanks
    – Ross
    Nov 1, 2017 at 23:11

1 Answer 1

0

Start-Process .\ssh.cmd "$user $computer $password" does not suspend

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .