style: format command string for PowerShell execution

This commit is contained in:
Paul Gauthier (aider) 2024-09-10 06:51:43 -07:00
parent 4605969921
commit 1327c1e893

View file

@ -31,7 +31,9 @@ def run_cmd_subprocess(command, verbose=False):
# Use PowerShell if it's the parent process
if "powershell" in os.environ.get("PSModulePath", "").lower():
shell = "powershell"
command = f'powershell -ExecutionPolicy Bypass -Command "& {{({command}) | Out-String}}"'
command = (
f'powershell -ExecutionPolicy Bypass -Command "& {{({command}) | Out-String}}"'
)
else:
shell = "cmd"
else: