I'm trying to run a python script using PowerShell. In that python script I try to use a command line argument which includes double quotes and whitespace, which does not work properly. I suspect it to be an issue with PowerShell.
The (simplified) python script looks like this:
import sys
print(sys.argv[1])
The following calls and outputs show the problem
python script.py --arg=foo
--arg=foo
python script.py --arg='\"foo\"'
--arg="foo"
python script.py --arg='\"fo o\"'
--arg="fo
But what I need in the end is
--arg="fo o"
It strips away everything after the whitespace. I tested the same script in a Linux bash where it worked (with double quotes around the foo). This seems not to be a python issue but a PowerShell problem, can anyone help me? In the end I want to have a full JSON-String as the argument.