Allows use of inline powershell for cmd.script args

Fixes #356195
This commit is contained in:
Loren Gordon 2020-02-18 15:22:56 -08:00
parent be2e67c0a0
commit fcd1699f5e
No known key found for this signature in database
GPG key ID: BA81DB57D5ACCD5E

View file

@ -344,7 +344,7 @@ def _run(cmd,
# The last item in the list [-1] is the current method.
# The third item[2] in each tuple is the name of that method.
if stack[-2][2] == 'script':
cmd = 'Powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -File ' + cmd
cmd = 'Powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass {0}'.format(cmd.replace('"', '\\"'))
elif encoded_cmd:
cmd = 'Powershell -NonInteractive -EncodedCommand {0}'.format(cmd)
else: