简体   繁体   English

Powershell 脚本启动 Putty

[英]Powershell script launch Putty

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:我想创建一个 powershell 脚本,允许我启动带有参数的 PuTTy,以串行通知与“读取主机”连接 这是我现在的代码:

#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""就在我的脚本启动期间,我可以输入我的信息,但是 putty 的错误 window 标记我“意外参数“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我不知道我的代码哪里搞砸了,或者只是 putty 不喜欢使用 powershell。非常感谢你的帮助

Thanks a lot !非常感谢 !

Powershell has an SSH module built-in for creating remote connections. Powershell 内置了一个 SSH 模块,用于创建远程连接。 See PowerShell Docs for SSHPowerShell 文档 SSH

As you can see in the Putty Commandline docs , Putty requires different parameters to start putty.exe from the command-line.正如您在Putty 命令行文档中看到的那样,Putty 需要不同的参数才能从命令行启动 putty.exe。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM