1

I want to update the Multiline Text field to Rich Text in the Document library using PnP PowerShell.

I tried to find the property which can do the trick but did not have any luck.

Can someone help me identify which property I need to set up while using PnP PowerShell?

Set-PnPField

1 Answer 1

2

Two properties needs to be set in Schema i.e. RichText to TRUE and RichTextMode to FullHtml. Those property you can't set it directly via Set-PnPField so you need to get existing schema first and you need to update two attribute accordingly.

You can try below script to do so.

$libraryURL = "Shared Documents"
$internalName = "TestField2"
$field = Get-PnPField -List $libraryURL -Identity $internalName
[xml]$schemaXml = $field.SchemaXml
$schemaXml.Field.SetAttribute("RichTextMode", "FullHtml")
$schemaXml.Field.SetAttribute("RichText", "TRUE")
Set-PnPField -List $libraryURL -Identity $internalName -Values @{SchemaXml=$schemaXml.OuterXml}

Took hint from https://github.com/pnp/PnP-PowerShell/issues/2701#issuecomment-637561473

1
  • thanks Kalpesh Vaghela. I also had to modify the property IsolateStyles to true $schemaXml.Field.SetAttribute("IsolateStyles", "TRUE") Apr 4, 2023 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.