Given below is the code snippet you could use to add default content to your document set using PnP PowerShell
#Get Document Set $DocSet=Get-PnPDocumentSetTemplate -Identity [Doc set CT Name] #get content type that you wish to add to the doc set $cType=Get-PnPContentType -Identity 0x012000EA96A187C681F245B24F1DCDF5EF9B76 [byte]$bytes = Get-Content $sampleFile -Encoding byte $sampleFile="C:\Test\SampleFile.docx" #Get File Content [byte]$bytes = Get-Content $sampleFile -Encoding byte #This section could be added into a for loop based on the number of folders you need to add #Add Default Content $DocSet.DefaultDocuments.Add("[Folder Name]/SampleFile.docx",$cType.Id,$bytes) $DocSet.Update($true) Invoke-PnPQuery #Get Document Set $DocSet=Get-PnPDocumentSetTemplate -Identity [Doc set CT Name]
This can also be done via UI as shown below:
Navigate to [SiteUrl]/_layouts/15/mngctype.aspx and select the document set you want to add default content to:
Select Document Set Settings
You can change the allowed content type and add your own custom content types to restrict type of content within your document set.
Then in the Default Content, you can select the content type for which you want to put the default content and you can also give a folder name and File Name and then choose a default file.
If you have given the Folder name then the document will come inside the Folder. You can add multiple files by clicking on the ‘Add new default content’ link’. At a time you can only add 10 folders/files. If you need to add more, Save the first 10 and reopen this page again to add more.
Once you have added the default content via PowerShell or UI, add the document set content type to a new library. When you create a new document set from this content type this is how it would look like
and when you click on the doc set, it displays the default folders you have created