Dienstag, 27. November 2012

PublishingWeb unable to create page

I ran into a problem, where I wanted to create a page through PowerShell and then I received errors, when using the PublishingWeb object.

After a while I figured out, that you need to enable the web-scoped feature: SharePoint Server Publishing - 94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb

and then you might have to check if the web, does have a property-bag key "__PagesListId".
If not, create a key and save there the Guid of the document library, where you save the pages in. Default en-US install is "Pages"-library.
If you already do have the key, make sure, that the value corresponds to the Guid of the library, you save the pages in.