Background

I was continuing with my SharePoint journey. Today’s my topic was to create custom page based on a Custom Page Layout in our Site Collection. In this blog, I will provide self-described script and this script will create the page using our custom page layout. This script will create the pages in a publishing portal only. If you want to create page in other than publishing site then you need to change the script accordingly.

It is a very straight forward script. I have a publishing site and my custom Page Layout has been deployed on the Publishing site as following figure.

Files

Now following script will create the page in provided web site.

Script:

After running the script, my required page created in the site as shown in following figure.

pages