Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Escape Parsed Content in PowerShell String

$
0
0

Summary: Use the backtick character to insert data normally parsed by Windows PowerShell in a string.

Hey, Scripting Guy! Question Certain characters (such as the colon and double quotation marks) are special in Windows PowerShell.
           How can I use those in a parsed string?

Hey, Scripting Guy! Answer Use the backtick character (usually under the tilde, and it’s also ASCII character 96), for example:

$OSDrive=’C’

$DriveLetter=”$OSDrive`:”


Viewing all articles
Browse latest Browse all 3333

Trending Articles