powershell
powershell copied to clipboard
[FEATURE] Implement Values parameter for cmdlet Set-PnPContentType
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)