PowerShell Script to update Page Layout in SharePoint online using PnP

Hi Friends,

I have came across a very common requirement where I need to update the page layout of the SharePoint online page (classic page), but I think same can be used to update the page layout to the modern SharePoint site.


For this I have written a PowerShell script which will update the pages from a specif page layout to the desired page layout. In this script I have also taken care if you are updating the page layout of the subsite, than also this script will handle the scenario.

There are 2 parameters which you need to update
  • Old page layout title
  • New page layout title

The updation due to this script will not change the modified by as well as modified date, so the original data is not lost.

Please provide your comment if you feel that something can be enhanced in the script or if there is any issue


Popular posts from this blog

SharePoint Framework (SPFx) : Cascade dropdown in webpart properties

Checking user permission in SharePoint Framework (SPFx) webpart

SharePoint Image Gallery