Created
May 9, 2019 06:39
-
-
Save OlafD/cc2eae79b92b3b334aab0cfc16a48a37 to your computer and use it in GitHub Desktop.
Make the title field visible for editing in the Folder content type in a library in SharePoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get the content type from the library | |
| $ct = Get-PnPContentType -Identity "Folder" -List "Documents" | |
| # get the fieldlinks collection from the content type | |
| $fieldLinks = $ct.FieldLinks | |
| (Get-PnPContext).Load($fieldLinks) | |
| Invoke-PnPQuery | |
| # get the title field from the site columns | |
| $titleField = Get-PnPField -Identity "Title" | |
| $fieldLinks.GetById($titleField.Id) | |
| # load the fieldlink for the title field | |
| $fieldLink = $fieldLinks.GetById($titleField.Id) | |
| (Get-PnPContext).Load($fieldLink) | |
| Invoke-PnPQuery | |
| # make the title field visible | |
| $fieldLink.Hidden = $false | |
| $ct.Update($false) | |
| Invoke-PnPQuery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment