Forum Discussion
Nigel Price
Sep 29, 2017Iron Contributor
How do I know if a page is in modern UI mode using PnPPowerShell ?
I need to audit a site and one of my tasks is to ensure that all pages are in Modern UI mode, the other thing I need to know is what Client Side Web Parts are deployed to each page. I want to use...
Sep 29, 2017
Have you tried using Get-PnPClientSidePage?
- Nigel PriceSep 29, 2017Iron Contributor
Hi Pieter
What is the diffeence between get-PnPWebPart and Get-PnPClientSidePAge ?
I get "object reference not set to an instant of an object" when I use Get-PnPClientSidePage.
I get nothing when I use Get-PnPWebPart
The page was created in the root site and is has the modern UI.
Regards
Nigel
- Sep 29, 2017
You should get something like this:
Get-PnPClientSidePage home.aspx PageTitle : Sections : {OfficeDevPnP.Core.Pages.CanvasSection} Controls : {7f718435-ee4d-431c-bdbf-9c4ff326f46e, a5df8fdf-b508-4b66-98a6-d83bc2597f63, df611e7c-5498-4843-a936-14e8ec332dcd, eb95c819-ab8f-4689-bd03-0c2d65d47b1f} LayoutType : Home KeepDefaultWebParts : False Context : OfficeDevPnP.Core.PnPClientContext PagesLibrary : SitePages PageListItem : Microsoft.SharePoint.Client.ListItem DefaultSection : OfficeDevPnP.Core.Pages.CanvasSection CommentsDisabled : Falseif you had a traditional page you would get:
Get-PnPClientSidePage : Page 'home.aspx' does not exist
- Nigel_Price9911Sep 29, 2017Iron Contributor
I have tried this and I get the errors in the attached file.