jeudi 18 décembre 2014

Why do I get this error creating a web part page in Sharepoint 2010?



The following appears to be the way to create a web part page in Sharepoint 2010 using Powershell:



$web = Get-SPWeb http://somesite
$pWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$pageLayout = $pWeb.GetAvailablePageLayouts() | Where { $_.Name -eq "BlankWebPartPage.aspx" }
$folder = $web.GetFolder("SitePages")
$page = $pWeb.AddPublishingPage("spamDoc.aspx", $pageLayout, $folder)


But when I run it I get:



PS C:\Users\spadmin> $page = $pWeb.AddPublishingPage("spamDoc.aspx", $pageLayout, $folder)
Exception calling "AddPublishingPage" with "3" argument(s): "Invalid field name. {fa564e0f-0c70-4ab9-b863-0177e6ddd247}
At line:1 char:32
+ $page = $pWeb.AddPublishingPage <<<< ("spamDoc.aspx", $pageLayout, $folder)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException


I am trying to create a new web part page in the site's Site Pages library. Any help appreciated.








0 commentaires:

Enregistrer un commentaire