I am using SharePoint 2013 on premises to build an application which utilizes a Document Set Content Type. I have used the GUI to:
- Create Site Columns for the website;
- Create a Document Set Content Type for the website;
- Assign those Site Columns to the Document Set Content Type ("add from existing site columns");
- Assign Default Content to the Document Set Content Type in the form of folders and files (see image); and
- Added the resulting Document Set Content Type to a Document Library (Library Settings, "Add from existing site content types").
The resulting Document Library works just fine, but a site template of the website does not re-create my Document Set Content Type, no doubt because of some error in the many steps and clicks required by the GUI approach.
The folder and file structure contained by an instance of our Document Set Content Type includes several levels of subfolders for a total of about thirty entities (folders and files).
To accelerate development and trouble-shooting, I have successfully written and tested a PowerShell script to duplicate all of those steps, except number 4. I have no idea how to do it. The examples I have seen of creating folders and files in a Document Set Content Type all speak to adding default content to a Document Set after it is in a List. My requirements are that the Document Set Content Type and its default content exist prior to the Content Type being added to a Document Library, just as it is done in the GUI.
What SharePoint objects, methods, and properties will achieve the same result that the GUI achieves with respect to step 4?