pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
680 stars 348 forks source link

[FEATURE] Implement Values parameter for cmdlet Set-PnPContentType #4392

Open zenlord opened 1 month ago

zenlord commented 1 month ago

Is your feature request related to a problem? Please describe. Currently it looks like it is not possible to change (e.g.) the default list content type view. In the GUI, this option can be set using a field labeled 'Welcome Page View', and this field is available in the SchemaXML field of the list content type. Currently it is possible to "get" the SchemaXML value and make changes to it, but there's no way to replace the SchemaXML value:

> $ct.SchemaXml = $xml.OuterXml
InvalidOperation: 'SchemaXml' is a ReadOnly property.

Describe the solution you'd like

> Set-PnPContentType -List $list -Identity $ct.Id -Values @{SchemaXml=$xml.OuterXml}
Set-PnPContentType: A parameter cannot be found that matches parameter name 'Values'.

OR

> Set-PnPContentType -List $list -Identity $ct.Id -SchemaXml $($xml.OuterXml)
Set-PnPContentType: A parameter cannot be found that matches parameter name 'SchemaXml'.

Describe alternatives you've considered

None - I tried to implement it using CSOM, but didn't get far. I guess the first step would be to replace the 'ReadOnly' value of the SchemaXml property, but I don't know how to do that (or whether that is possible at all)

kachihro commented 4 weeks ago

Same question here - provisioned a set of Content Types - and Doc.Sets - but now need to set the "WELCOME PAGE" for the Doc.Set. This can't be done via PNP.PowerShell - only option I saw was a crazy IE.ScreenDriver - to manipulate via the UI - using script...!