SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been asked if it is possible to do a bulk creation of a number of pages, into the "SitePages" folder on SharePoint 2013.

I have seen some references on the web of how to achieve this via XML, but with little success.

Ideally, I would like to have an XML file, that has a structure similar to this

  • Page title
  • Page content (either flat, or HTML)

I would then see me parsing a file stored in c:\, and the powershell would loop through and create each page.

Would this be possible?



share|improve this question

Format your code as such. Let's say you want to create 10 new pages.

$Web = Get-SPWeb -Identity "url of your site"
$myWeb =[Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($Web)

$myLayout = $myWeb.GetAvailablePageLayouts() | Where { $_.Name -eq "BlankLayout.aspx" }

for($i=1; $i -le 10; $i++) {
   $myNewPage = myWeb.AddPublishingPage("Page" + $i + ".aspx", $myLayout)

The BlankLayout file is the layout you created for the empty pages. in the AddPublishingPage function, I am concatinating Page#.aspx with i, so it'll be Page1.aspx, Page2.aspx, so on. I think it can work like that. Just find a way to make a new page name during the loop. You can then change the number based on how many pages you would like to create.

Here is my source:

share|improve this answer
Thanks for the reply. I was hoping to be able to have an XML that I could parse with my content. Is that something I could add into this code snippet? – Rob Sked Jun 30 '14 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.