In this blog, we are going to see how to create a new modern Site Page in SharePoint site using PnP PowerShell.
Add-PnPClientSidePage command from PnP PowerShell will do the creation of a new modern page in SharePoint site.
Modern site page is created by using any one of the below two ClientSidePagelayoutTypes,
- Home
- Article
Create Article layout modern page
The below PowerShell command is used to create a modern article page in a SharePoint site.
- PS:> $cred = Get-Credential
- PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred
- PS:> Add-PnPClientSidePage -Name “Article Page”
The page URL will be https://<tenant>.sharepoint.com/sites/dev/sitepages/article page.aspx


Output


By default, Add-PnPClientSidePage creates an Article layout type. To create the Home layout type, we have to pass the Home as a LayoutType parameter.
We can also use the below command to create the same page without providing a –Name parameter
By default, Add-PnPClientSidePage creates an Article layout type. To create Home layout type, we have to pass the Home as a LayoutType parameter.
We can also use the below command to create the same page without providing the –Name parameter.
We can also use the below command to create the same page without providing the –Name parameter.
- Add-PnPClientSidePage “Article Page”
Create Home Layout Modern Page
The below PowerShell command used to create a home layout modern page in SharePoint Site Pages library.
- PS:> $cred = Get-Credential
- PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred
- PS:> Add-PnPClientSidePage -Name “Home Page” -LayoutType Home

The Page URL will look like: https://<tenant>.sharepoint.com/sites/dev/sitepages/home page.aspx
Output


henry jonesPosted Jun 4, 2018, 1:48 PM
Is there a script to add Modern Page to all Site Collections and then Make HomePage?
Marc VanderstraetenPosted Mar 21, 2018, 9:21 AM
How to create "The" default home page that includes "News", "Activities" and "Comments" instead of an empty page?