Q. What is Windows PowerShell’s escape character, and how is it used?
Don Jones
May 19, 2010
1 Min Read
A. PowerShell uses the back tick (`) as its escape character. On a US keyboard, it appears in the upper-left of the main keys, next to the 1. It's on the same key as the tilde (~) character. Depending on the font you’re using, the back tick can be tough to distinguish from a single quote, so be careful!
In most cases, the back tick removes the “specialness” of any character. For example, PowerShell uses spaces as a separator in commands. That means parameters that contain spaces must normally be enclosed in quotation marks:
Dir "c:program files"
An alternative is to escape the space character, making it a literal character:
Dir c:program` files
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like