Anyway to keep spaces and line breaks in UD?


Hey Everyone,

Am I missing something… is there a way to keep spaces and line breaks in UD? When I try and create any string with line breaks or multiple spaces UD removes them all.


Automation Job Output in PS


  • Sorry for double post, only allowed to upload 1 image at a time :expressionless:

then the same result in UD


Hmmm. Seems like it should account for this.

You might be able to get around this by doing something like this. This replaces the new line characters with the HTML

$Html = New-UDHtml "<div>$($AzureRMAutomationJobOutput.Replace('`n', '<br/>'))"
New-UDCard -Content { $Html }


Thanks Adam - I just tired it quickly and getting the same result. Ill spend some time with it later to see if it was my copy/paste skills.


I’ve preserved formatting in Cards using Here Strings before and it worked.

$body = @"
This is line 1

This is a paragraph

New-UDCard  -Title "Test" -Text $body