Powershell – Defined a new variable, broken with quotation marks

powershell

my new defination is

$var="Tony said:"I like this game!""

It appeared that only

"Tony said:"

part can be recoginized, but I need the whole sentence. What can I do?

Best Answer

http://ss64.com/ps/syntax-esc.html

A simple solution is to just double the quotes. See the link for other options.

$var="Tony said:""I like this game!"""