I am trying to create a regular web part page with powershell and I am not able to do it. There is no information in google about the error I get:
$spWeb = Get-SPWeb -Identity "http://server/site"
$pl = $pubWeb.GetAvailablePageLayouts()
Exception calling "GetAvailablePageLayouts" with "0" argument(s): "Object reference not set to an instance of an object."
At line:1 char:38
+ $pl = $pubWeb.GetAvailablePageLayouts <<<< ()
+ CategoryInfo : NotSpecified: (: ) [ ], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
The error occurs when executing
Any clue? Thank you.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)