Skip to content

Commit 439798b

Browse files
authored
Merge pull request #841 from Tanddant/Add-Modern-Document-Sets
🔨 - Added option to create document sets with modern layout
2 parents 4ab504c + 8a95970 commit 439798b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

scripts/spo-documentset-configuration/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ param (
2828
[Parameter(Mandatory = $true)]
2929
[string] $columnsToAddToDocSet = "Company,Department",
3030
[Parameter(Mandatory = $false)]
31-
[string] $docSetToAdd = "CompanyA,CompanyB"
31+
[string] $docSetToAdd = "CompanyA,CompanyB",
32+
[Parameter(Mandatory = $false)]
33+
[boolean] $enableModernLayout
3234
)
3335
3436
Connect-PnPOnline -Url $siteUrl
@@ -83,6 +85,15 @@ Get-PnPList | Where-Object { $_.BaseTemplate -eq 101 -and $_.Hidden -eq $False -
8385
}
8486
}
8587
}
88+
89+
if($enableModernLayout) {
90+
# Enable modern layout for the content type
91+
$ct = Get-PnPContentType -Identity $docsetCTName -List $list
92+
$ct.NewFormClientSideComponentId = $null
93+
$ct.Update($false)
94+
Invoke-PnPQuery
95+
Write-Host -f Green "Modern layout enabled for content type $docsetCTName in library $($list.Title)!"
96+
}
8697
}
8798
```
8899

@@ -96,9 +107,10 @@ Sample first appeared on [Automate SharePoint Document Set Configuration with Po
96107

97108
## Contributors
98109

99-
| Author(s) |
100-
|-----------|
110+
| Author(s) |
111+
| ------------------------------------------------ |
101112
| [Reshmee Auckloo](https://github.com/reshmee011) |
113+
| [Dan Toft](https://dan-toft.dk) |
102114

103115

104116
[!INCLUDE [DISCLAIMER](../../docfx/includes/DISCLAIMER.md)]

scripts/spo-documentset-configuration/assets/sample.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"This script streamlines the setup of Document Sets across multiple libraries by enabling the feature, creating a custom content type, adding site columns, and integrating it into document libraries while excluding system libraries. It also automates the creation of sample document sets with metadata and enhances the default view by adding relevant columns."
1010
],
1111
"creationDateTime": "2025-05-18",
12-
"updateDateTime": "2025-05-18",
12+
"updateDateTime": "2025-05-25",
1313
"products": [
1414
"SharePoint",
1515
"Libraries"
@@ -50,6 +50,12 @@
5050
}
5151
],
5252
"authors": [
53+
{
54+
"gitHubAccount": "Tanddant",
55+
"company": "",
56+
"pictureUrl": "https://github.com/Tanddant.png",
57+
"name": "Dan Toft"
58+
},
5359
{
5460
"gitHubAccount": "reshmee011",
5561
"company": "",

0 commit comments

Comments
 (0)