Skip to content

Instantly share code, notes, and snippets.

@alecthegeek
Last active April 5, 2019 05:59
Show Gist options
  • Save alecthegeek/dd9532d2dc31ab9ef7feda002c7fd17f to your computer and use it in GitHub Desktop.
Save alecthegeek/dd9532d2dc31ab9ef7feda002c7fd17f to your computer and use it in GitHub Desktop.
Json on the Powershell command line
# Run some program that needs to supply valid json strings (that contain `"`)
# note the use of backtick to escape newlines
# AND NOTE that from --% onwards the backtick no longer works. It must be on one line!
# This information helped me
# https://ss64.com/ps/syntax-esc.html
& 'C:\Program Files\<app>\<program>.exe' `
arg1 arg2 `
--% "{""key1"":""value1""},{""key2"":""value2""}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment