Skip to content

Instantly share code, notes, and snippets.

@OlafD
Created May 9, 2019 06:39
Show Gist options
  • Select an option

  • Save OlafD/cc2eae79b92b3b334aab0cfc16a48a37 to your computer and use it in GitHub Desktop.

Select an option

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.
# 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