Skip to content

Cloud Foundry How Tos - Escape quotes of json objects in command line

There are differences in escaping quotes of json objects in command line. The following example shows the correct escaping for Linux / Mac, Windows Command Line and Windows PowerShell.

  • Linux / Mac:
    cf update-service <servicename> -c '{"update": true}'
  • Windows Command Line:
    cf update-service <servicename> -c "{\"update\": true}"
  • Windows PowerShell:
    cf update-service <servicename> -c '{\"update\": true}'

Any questions left?

Ask the community

Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.