C# verbatim strings and PowerShell here-strings have just enough in common to be confusing. The differences are summarized here.
C# verbatim strings | PowerShell here-strings |
---|---|
May contain line breaks | Must contain line breaks |
Only double quote variety | Single and double quote varieties |
Begins with @” | Begins with @” (or @’) plus a line break |
Ends with “ | Ends with a line break followed by “@ (or ‘@) |
Cannot contain un-escaped double quotes | May contain quotes |
Turns off C# escape sequences | @’ turns off PowerShell escape sequences but @” does not |