youssef ibrahimi

youssef ibrahimi

  • NA
  • 52
  • 1.2k

Create a Publishing HTML Site Column using PnPPowershell

Aug 21 2018 5:13 AM
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
 
I have the error below :
 
Add-PnPField : Cannot bind parameter 'Type'. Cannot convert value "HTML" to type
"Microsoft.SharePoint.Client.FieldType". Error: "Unable to match the identifier name HTML to a valid enumerator name.
Specify one of the following enumerator names and try again: Invalid, Integer, Text, Note, DateTime, Counter, Choice,
Lookup, Boolean, Number, Currency, URL, Computed, Threading, Guid, MultiChoice, GridChoice, Calculated, File,
Attachments, User, Recurrence, CrossProjectLink, ModStat, Error, ContentTypeId, PageSeparator, ThreadIndex,
WorkflowStatus, AllDayEvent, WorkflowEventType, Geolocation, OutcomeChoice, MaxItems"
At line:1 char:92
+ ... nPGroup" -Type HTML
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [Add-PnPField], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,SharePointPnP.PowerShell.Commands.Fields.AddField
 
Can you tell me which is the appropriate type to create a "Publishing HTML" column ?
 
Thanks for the help.

Answers (3)