Using indentation on the closing element of a here-string causes the element to be considered part of the here-string
$ThisHereString=@"
Item
item1
item2
"@
Foreach ($line in $ThisHereString) { etc...
vs
$ThisHereString=@"
Item
item1
item2
"@
Foreach ($line in $ThisHereString) { etc...