How to export all the webpart in a sharepoint online page using Powershell?
Below are the power shell script to export all the web part in a SharePoint Page . foreach($item in $items) { $file = $context.Web.GetFileByServerRelativeUrl($Item[“FileRef”]) if($Item[“FileRef”] -eq “/sites/testwebpartpage.aspx”){ $wpManager = $file.GetLimitedWebPartManager([Microsoft.SharePoint.Client.WebParts.PersonalizationScope]::Shared) $context.Load($file) $webparts = $wpManager.Webparts $context.Load($webparts) $context.ExecuteQuery() $ pelement = $XMLFile.CreateElement(“Page”) $ pelement .SetAttribute(“id”, $Item[“ID”]) $ pelement .InnerText = $Item[“FileRef”] $ pelement .AppendChild($PageElement) | Out-Null foreach($webpart […]