Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Adding List item via powershell - Multiline formatting is lost (no line breaks)

$
0
0

Hello guys,

i've got a problem when adding new items to a custom list in Sharepoint.
Inside powershell i've got a string with multiple lines.

Example:

#Just an example
$example = @"
Line 1
Line 2
Line 3"@


Write-Output $example


#Looks like this:
#Line 1
#Line 2
#Line 3


But when i add a new list item ($example to a multiline text column) to sharepoint like this:

$newItem["Description"] = $example
$newItem.Update()


it looks like this in Sharepoint:
Line1Line2Line3


My multineline column inside the view.aspx looks like this:

<td width="400px" valign="top" class="ms-formbody"><xsl:value-of select="@Description" disable-output-escaping="yes"/></td>

Sadly i NEED to use powershell for this.

Anybody got an idea?

Edit: The multi-line column is a advanced richt text multiline column

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>