Jan 10 2017 01:12 AM
Is there a method to hide content type from the 'new' menu on a list in the same way using the UI located at _layouts/15/ChangeContentTypeOrder.aspx. I have tried using following script, issue here is that it total hides the content type in the edit form 😞
$l = Get-PnPList -Identity "lists/MyList"-Web $web
$ctx = Get-pnpContext
$ctx.Load($l.ContentTypes)
$ctx.ExecuteQuery()
foreach ($ct in $l.ContentTypes)
{
$ct.Name
if ($ct.Name -eq 'ContentTypeName1')
{
$ct.Hidden=$true
$ct.Update($false)
}
}
$ctx.ExecuteQuery()
Regards...
Jan 10 2017 11:29 PM
Hi Rod,
you first need to add the new contenttype then change all items to the new contenttype end remove the contenttype.
thought i had some code but could not find it right now.
kr,
Paul
Nov 29 2018 08:34 AM
You can do that with the following code: