我想编写一个 PowerShell 脚本,它将在远程 PC 上执行 Python 脚本。该脚本提示用户输入“Y”或“N”以继续执行它。
要远程登录,我输入
enter-pssession -ComputerName <Computer Name> -Credential <DOMAIN>\<username>
然后我输入:
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 机器。