SharePoint Online - Save a modern SharePoint list as a template
Requirement : To save a modern SharePoint list as a template to xml file to add in update.xml or as a backup AND it was very handy to copy list definition and even to migrate lists with its content. . You will need to manually define all the columns that you want to extract with data as shown in the example below. Here is the script: ######################################################## $targetWeb = "https://your-site.sharepoint.com/sites/collection/" ## URL of the site $clientid = "abc-abc-abc-abc-abc" #Add client id of site $clientsecret = "abcdefghijklmnopq=" #Add client secret of site $listname = "Employee" ######################################################## try { Connect-PnPOnline -Url $targetWeb -AppId $clientid -AppSecret $clientsecret; $clientContext = Get-PnPContext; Write-Host "Connection to site established: " $targetWeb; Export-PnPListToProvisioni...