1

This is what happens when I try to run python code through the powershell prompt.

PS > python -c 'import json; d = {"type": "info" }; print(json.dumps(d))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'info' is not defined
PS >

What is the correct way to write the powershell statement to do this?

deostroll
  • 11,661
  • 21
  • 90
  • 161
  • 1
    The sad reality as of PowerShell 7.2 is that an _extra, manual_ layer of `\ `-escaping of embedded `"` characters is required in arguments passed to _external programs_. This _may_ get fixed in a future version, which _may_ require opt-in. See the [linked duplicate](https://stackoverflow.com/a/59036879/45375) for details. – mklement0 Feb 05 '22 at 22:13

0 Answers0