Windows / PowerShell
PowerShell String Escaper
This tool helps escape strings correctly for PowerShell. It creates variants for single-quoted strings, double-quoted strings and here-strings, and shows warnings for dollar signs, backticks, line breaks and here-string terminators.
Create PowerShell strings
Paste text, paths, JSON, arguments or code fragments. The output is generated locally in your browser and is not sent to a server.
Useful for paths, API parameters, JSON fragments, log text and longer script text.
0 characters
The output is a copy template. Review commands before running them, especially paths, administrator rights and scripts.
Output overview
Quick orientation
- Single quotes are often the safest choice for literal text because variables are not expanded.
- Double quotes are useful when PowerShell should expand variables or interpret escape sequences.
- Here-strings are useful for multiline text, JSON, script blocks or long templates.
- Paths with spaces belong in quotes. For wildcard characters,
-LiteralPathcan be the better choice.