[FEATURE] Implement Values parameter for cmdlet Set-PnPContentType
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 904
- Forks
- 407
- Avg merge
- 9h 16m
- Merged PRs (30d)
- 10
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Set-PnPContentType cmdlet and reading the CSOM ContentType SchemaXml property and its update behavior. Confirm whether Values or a SchemaXml parameter can expose the requested change, and consider the issue done when the cmdlet updates SchemaXml for a list content type and has coverage for the requested invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100