I would like to set a string with special chars in it ($ for example). How can I save a string as a raw string?
$B = "A$$B" isnt saved 开发者_开发技巧as "A$$B".
Thanks.
If the string is in '
(single quotes) the variables ( like $x
) are not expanded.
Also, Powershell has here-strings
much like verbatim strings in C#
http://blogs.msdn.com/b/powershell/archive/2006/07/15/variable-expansion-in-strings-and-herestrings.aspx
maybe you can use the ` to escape chars (called 'backqoute')
Use single quotes to set literal values in Powershell:
$B = 'A$$B'
精彩评论