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...
Nigel Price
Sep 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.
- Sep 29, 2017
Hi Nigel_Price9911,
You don't need to add the double quotes to the file names. So either:
Get-PnPClientSidePage A-Modern-Page.aspx
or
if you prefer to enter it on the Identity prompt then also no quotes.
- Nigel_Price9911Sep 29, 2017Iron Contributor
Hi Pieter
I tried that and I still get the "Object Reference not set to an instance of an Object"
Regards
Nigel