Reputation: 436
I'm trying to create a sharepoint 2016 site column using PnP powershell.
when I create a single line of text using the command below it works:
Add-PnPField -DisplayName "column1" -InternalName "column1" -Group "PnPGroup" -Type Text
But I can't create a "Publishing HTML" column using this command :
Add-PnPField -DisplayName "htmlcolumn" -InternalName "htmlcolumn" -Group "PnPGroup" -Type HTML
Can you tell me which is the appropriate type to create a "Publishing HTML" column ?
Thanks for the help.
Upvotes: 0
Views: 399
Reputation: 2500
You can use Add-PnPFieldFromXml
to add the field as below:
$guid = New-Guid
$xml = '<Field Type="HTML" Name="htmlcolumn" DisplayName="htmlcolumn" Group="PnPGroup" StaticName="htmlcolumn" RichText="TRUE" ID="{'+$guid.Guid+'}" RichTextMode="FullHtml" />'
Add-PnPFieldFromXml -FieldXml $xml
After that, you can see in the site columns as:
Reference - Add-PnPFieldFromXml
Upvotes: 1