How To Get Different Properties From Modern Page In SharePoint Using PnP PowerShell

This blog will help you to learn how to retrieve the different associated properties to the modern SharePoint page using PnP PowerShell.
 
Get-PnPClientSidePage PowerShell command helps you to retrieve the properties of the modern page. At present, we can retrieve the below properties.
  • PageTitle
  • Sections
  • Controls
  • LayoutType
  • KeepDefaultWebParts
  • Context
  • PagesLibrary
  • PageListItem
  • DefaultSection
  • CommentsDisabled
In future, there are chances for more properties to be included in the list.
 
The below PowerShell command is used to retrieve all associated available properties of the particular modern page.
  1. PS:> $cred = Get-Credential  
  2. PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred  
  3. PS:> Get-PnPClientSidePage -Identity “Home Page”  
 
 
 We can also pass the Get-PnPClientSidePage command in the following ways,
  1. PS:> Get-PnPClientSidePage -Identity “Home Page.aspx”  
  1. PS:> Get-PnPClientSidePage “Home Page”  
  1. PS:> Get-PnPClientSidePage “Home Page.aspx”  
The below PnP PowerShell command helps to retrieve the specific property from specified modern page.
  1. PS:> $cred = Get-Credential  
  2. PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred  
  3. PS:> Get-PnPClientSidePage “Home Page” | Select-Object PageTitle,CommentsDisabled