Escaping Characters

Often a special character may be used—for example, in DOS commands—but PowerShell tries to interpret it differently. Let’s consider the dollar sign character ($). PowerShell normally tries to interpret it as a variable:

image

The preceding example shows how the escape character, which is the backtick (`), is used to escape the dollar sign, so that PowerShell doesn’t try to interpret the character literally as the beginning of a variable.

Note

You can execute the Get-Help about_escape_character command in PowerShell for more information and examples.

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.