Below you will find pages that utilize the taxonomy term “Site Provisioning”
posts
Exporting and Migrating SharePoint Libraries with Folders Using PnP PowerShell
Introduction Recently, I was asked how to export the first-level folders in document libraries using PnP PowerShell site provisioning cmdlets. While Get-PnPSiteTemplate allows exporting SharePoint site configurations, it doesn’t directly cater to folders. After experimenting with various options, including Add-PnPDataRowsToSiteTemplate, I discovered the solution: the Add-PnPListFoldersToSiteTemplate cmdlet.
The Challenge The initial attempt involved using the Add-PnPDataRowsToSiteTemplate cmdlet with a CAML query to filter folders and it did not work.
Add-PnPDataRowsToSiteTemplate -Path Site.