pywinrm icon indicating copy to clipboard operation
pywinrm copied to clipboard

PowerShell hangs it if tries to prompt

Open HowardPWardinkle opened this issue 6 years ago • 0 comments

When running a PS script that inadvertently prompts (such as missing parameters), it will hang forever.

winrm/init.py around line 52 should add NonInteractive to have it error out instead of hanging forever.

rs = self.run_cmd('powershell -NonInteractive -encodedcommand {0}'.format(encoded_ps))

To test it run this PowerShell command Get-Content Since no parameters are supplied, it will try to prompt and hang pywinrm

HowardPWardinkle avatar Aug 30 '17 16:08 HowardPWardinkle