Home > Net >  Powershell script launch Putty
Powershell script launch Putty

Time:03-25

I would like to create a powershell script allowing me to launch PuTTy with parameters to connect in serial inform with a "read-host" Here is my code for now:

#For Serial connection
$ConnectionType = Read-Host "Enter your Connection type"
$SerialLine = Read-Host "Enter Your SerialLine like COM1"
$Speed = Read-Host "Enter your Bauds speed"

putty.exe $ConnectionType $SerialLine $Speed

And just during the launch of my script I can enter my information but an error window of putty marks me "unexpected argument "9600""

I don't know where I screwed up in my code or if it's just that putty doesn't like working with powershell. I would really appreciate your help

Thanks a lot !

CodePudding user response:

Powershell has an SSH module built-in for creating remote connections. See PowerShell Docs for SSH

As you can see in the Putty Commandline docs, Putty requires different parameters to start putty.exe from the command-line.

  • Related