Something like this ($content is just an example, I got the multiline string from the eventlog):
$content = “ä” + [environment]::newline + “ö”
New-UDParagraph -Text $content #outputs “äö”
New-UDParagraph -content {$content} #error can not output ä,ö
New-UDParagraph -Text $content.replace([environment]::newline,"") #outputs “äö”
IE: replace your new-line character with <br> in order to archieve this.
The content-param is a scriptblock, which needs to be invoked, and rendered as such.
The -text param might work, but using New-UDParagraph willl encase everything in <p>-tags.
Try using New-UDHTML -markup ($content -replace “\r\n”, “ ”)
Thanks for you reply. Maybe my post was slightly faulty. I have content with a line break but universal doeshboard doesn’t show the line break. So the line break is not replaced by automatically.
$content = “ä” + [environment]::newline + “ö”
New-UDParagraph -Text $content #Show as "ä ö"
New-UDParagraph -Content {$content} #Show as "ä ö"
New-UDParagraph -Text ($content -replace [environment]::Newline,"<br>") #Show as "ä<br>ö"
New-UDParagraph -Content {$content -replace [environment]::Newline,"<br>"} #Show as "ä<br>ö"
As you mentioned New-UDHTML inside the content block works.
The line break works with UDHTML in UDGrid too, but the UDGrid filter function does not work anymore. If i don’t use UDHTML line breaks doesn’t work but the filter works :-S
Could you try to wrap the markup-field in new-udelement?