Advertisement
Guest User

Untitled

a guest
May 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # get the content type from the library
  2. $ct = Get-PnPContentType -Identity "Folder" -List "Documents"
  3.  
  4. # get the fieldlinks collection from the content type
  5. $fieldLinks = $ct.FieldLinks
  6. (Get-PnPContext).Load($fieldLinks)
  7. Invoke-PnPQuery
  8.  
  9. # get the title field from the site columns
  10. $titleField = Get-PnPField -Identity "Title"
  11. $fieldLinks.GetById($titleField.Id)
  12.  
  13. # load the fieldlink for the title field
  14. $fieldLink = $fieldLinks.GetById($titleField.Id)
  15. (Get-PnPContext).Load($fieldLink)
  16. Invoke-PnPQuery
  17.  
  18. # make the title field visible
  19. $fieldLink.Hidden = $false
  20. $ct.Update($false)
  21. Invoke-PnPQuery
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement