When including a literal quote character inside a quoted string in Powershell, how do I escape the quote character to indicate it is a literal instead of a string delimeter?
|
From help about_quoting
|
||||
|
|
The escape character in Powershell is the "`" (backward apostrophe/grave). This can be used to escape quotes and also special characters (e.g., tab is `t). |
|||
|
To compliment what has already been provided here, you should also know that you can escape a quote (single or double) with the quote itself. That means you can do this: "Here's an example of a ""double-quoted string""." and this: 'This time it''s ''single-quoted''.' The advantage this syntax provides is simple: it's easier to type the same quote twice than it is to escape a quote with a backtick. |
|||
|
|
