I am on SharePoint Online environment and am trying to change page layouts of all pages with in a Publishing site. By default the page layout is basic and am trying to change all pages to use a custom layout that I built. I am able to do so manually but I want to do it using PowerShell.
I am using this code on https://www.sharepointwidgets.com/2019/02/powershell-script-to-update-page-layout.html but I get a this error,
Exception Happened on getAllPages : + Cannot bind argument to parameter 'Url' because it is an empty string.
Not really sure, why that's happening as I am passing the parameters
[string]$targetSiteURL = Read-Host "xxxxxxxxxxxxxxx" [string]$newPageLayoutTitle = "Custom Page" [string]$oldPageLayoutTitle = "Basic Page"
Please suggest or help with me with another solution.
Thanks.