A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Dear Jaap,
I do a test with SharePoint Online PnP script and I can enable the Document Set feature in SharePoint Online and add the document set content type to the site library.
If you haven’t tried the following script with SharePoint Online PnP, I suggest you try it to see the result.
- Enable the Document Set feature in a siote collection in SharePoint Online.
#Config Variable
$SiteURL = "https://tenantdomain.sharepoint.com/sites/sitecollectionname"
$FeatureId = "featureid of Document Set" #Site Scoped Document Set Feature
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
#get the Feature
$Feature = Get-PnPFeature -Scope Site -Identity $FeatureId
#Get the Feature status
If($Feature.DefinitionId -eq $null)
{
#sharepoint online powershell enable feature
Write-host -f Yellow "Activating Feature..."
Enable-PnPFeature -Scope Site -Identity $FeatureId -Force
Write-host -f Green "Feature Activated Successfully!"
}
Else
{
Write-host -f Yellow "Feature is already active!"
}
- Create the Document Set content type in the group Custom Content Type in the site collection.
$ParentCT = Get-PnPContentType -Identity “Document Set”
Add-PnPContentType -Name "MyNewCT" -Description "New CT created with PnP" -Group "Custom Content Type" -ParentContentType $ParentCT
- Add the Document Set content type to the site library DocTest.
$MyCT = "MyNewCT"
Add-PnPContentTypeToList -List "DocTest" -ContentType $MyCT -DefaultContentType
Meanwhile, as the issue only happens wjhen you create the Document Set content type with scripts and we have a specific platform MSDN forum coping with SharePoint scripts and customization related issues and questions, I suggest you post a new thread there for expert help.
Best Regards,
Cliff