Windows PowerShell - Interact with Python script Remote PC


  • I would like to write a PowerShell script which will execute a Python script on a remote PC. The script prompts the user to type 'Y' or 'N' to continue execution of it.

    To log in remotely, I type

    enter-pssession -ComputerName <Computer Name> -Credential <DOMAIN>\<username>

    Then I type:

    python ".\"

    The script prints out the text before the prompt, but instead of the prompt, I receive the following error message:

    python.exe : Traceback (most recent call last):
    + CategoryInfo          : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

    File ".\", line 19, in <module>
    File "C:\aimplatform2\aim\software_updater\", line 76, in execute
    = raw_input("> ")
    EOFError: EOF when reading a line

    If it helps, I am running Windows XP and remoting into a Windows XP machine.

    • Edited by Parthenon Saturday, July 28, 2012 9:35 PM
    Saturday, July 28, 2012 9:34 PM