I generally do all of my programmatic stuff using SharePoint PNP, but adding a content type to a list in a subsite does not show the content type as visible on the new button.
Because of this, I am looking to show it via code. I don't usually do this so looking for some help. So far I have this:
Connect-PnpOnline -Url $url -Credentials $creds
$ctx = Get-PnpContext
$web = $ctx.Web
$ctx.Load($web)
$ctx.ExecuteQuery()
$list = $ctx.Web.Lists.GetByTitle("My List Name")
$ctx.Load($List)
$ctx.ExecuteQuery()
$ct = Get-PnpContentType -List "My List Name" -Identity "My Content Type Name"
$ctid = $ct.id.StringValue
This is where I get stuck. Can't really find anything that does what I am trying to do. Basically I want to just do $contentType.Hidden = $false
.
Thanks.
This is what I want: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.contenttype.hidden.aspx