PowerShell Here-String that keeps newlines
In ISE works fine and in script
works too.
I don't remember where, but I read that is a bug in the console host code and empty lines are discarded when entered interactively for here-string.
At the moment I can't test if in Powershell V.3.0 console bug is fixed.
Link to the issue: http://connect.microsoft.com/PowerShell/feedback/details/571644/a-here-string-cannot-contain-blank-line
Workaround: add a backticks `
$string = @"
Line 1
`
Line 3
"@