Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 1
    Thanks for the detailed answer, but frankly none of these are acceptable solutions. I want to run a command like this: curl.exe -d '{"north": "east west"}' https://reqbin.com/echo/post/json without all the extra escaping. Since I am using single quotes, it should work. With Bash, you can use single quotes instead of escaping. The fact that PowerShell cant do this is pathetic Commented Mar 28, 2021 at 3:08
  • The answer lays out the reality of the situation - as much as you (and I) may dislike it - and provides the best workarounds currently available. I agree that PowerShell's shortcoming in this area is very unfortunate, and I've been working hard to get them to fix it. An opt-in fix may finally be coming, but to what degree it will fix the problems on Windows remains to be seen. That you don't like the reality of the situation is not a shortcoming of this answer. Commented Mar 28, 2021 at 3:17
  • It from the haydays of cmd.exe doing magical things, and powershell trying to be compatible to it, its all an unfortunate tragedy of the commons Commented Jul 27, 2022 at 15:36
  • 1
    @LuizFelipe, ultimately Windows is to blame here, for making applications do their own command-line parsing, opening the door for everyone to make up their own rules. cmd.exe certainly made up wacky rules, and PowerShell added its own broken behavior. cmd.exe is no longer actively maintained, so my hope was that PowerShell would not only fix its own mistakes, but compensate for cmd.exe's - alas, only the former will happen and possibly even require opt-in. Base64 encoding is fine (powershell.exe supports it too), but to be useful you need a simple way to create it from the calling shell. Commented Jul 27, 2022 at 20:36
  • 1
    @LuizFelipe, not special-case, unfortunately (which, when done right, would be a blessing): the current plan is to keep the old, broken behavior (broken on the PowerShell side). Commented Aug 5, 2022 at 16:43