why can't I create a here-string in Powershell ISE?

276 Views Asked by At

Trying to create a here-string

> $scriptblock =@'
The string is missing the terminator: '@.
 + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
 + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

Why am I getting this in the Powershell ISE, but it works normally in Powershell? Version 5.1.

> $scriptblock =@'
>> 

No, there's no space after the single-quote. I just hit enter. I even closed and reopened ISE and same thing.

1

There are 1 best solutions below

0
Roman On

Answer provided by Mathias R. Jessen: Press [Shift+Enter] to insert a literal newline in the ISE console