How to assign multiple lines string in Powershell Console

user310291 picture user310291 · Aug 3, 2015 · Viewed 22.5k times · Source

When I do enter this in powershell Console

$test=@'
Test
Test'@

And do enter several times, it keeps printing

>>

So I can never finish command.

What to do ?

Answer

user4003407 picture user4003407 · Aug 3, 2015

'@ should be first thing in the line or it is considered to be just a part of the string.

$test=@'
Test
Test
'@

This approach also works with @"/"@