2
我想编写一个PowerShell脚本,它将在远程PC上执行Python脚本。脚本提示用户输入'Y'或'N'继续执行。Windows PowerShell - 与Python脚本进行交互远程PC
远程登录,I型
enter-pssession -ComputerName <Computer Name> -Credential <DOMAIN>\<username>
然后I型:
python ".\update_software.py"
脚本打印出前提示中的文本,但不是的提示,我收到以下错误消息:
python.exe : Traceback (most recent call last):
+ CategoryInfo : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
File ".\update_software.py", line 19, in <module>
_runner.execute()
File "C:\aimplatform2\aim\software_updater\run_update.py", line 76, in execute
res = raw_input("> ")
EOFError: EOF when reading a line
如果有帮助,我运行Windows XP和远程处理到Windows XP机器。
那么有没有什么办法来执行这个脚本,包括提示或将删除提示解决我的问题? – Parth 2012-07-28 22:23:02
尝试替换raw_input并将所需的输入作为命令行参数提供给update_software.py – Meitham 2012-07-28 22:26:52
我这样做了,脚本能够运行。谢谢你的帮助 – Parth 2012-07-30 21:08:01