无法创建新的Web部件页 [英] Cannot create new Web Part Page

查看:127
本文介绍了无法创建新的Web部件页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好。



我正在尝试使用PowerShell创建常规Web部件页面,但我无法执行此操作。谷歌没有关于我得到的错误的信息:

Hello everybody.

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"
$pubWeb =[Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($spWeb)
$pl = $pubWeb.GetAvailablePageLayouts()



使用0参数调用GetAvailablePageLayouts的异常:对象引用未设置为对象的实例。

行:1字符:38


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



执行<$ c $时出错C> GetAvailablePageLayouts()。



任何线索?谢谢。


The error occurs when executing GetAvailablePageLayouts().

Any clue? Thank you.

推荐答案

spWeb = Get-SPWeb -Identity http:// server / site
spWeb = Get-SPWeb -Identity "http://server/site"


pubWeb = [ Microsoft.SharePoint.Publishing.PublishingWeb] :: GetPublishingWeb(
pubWeb =[Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb(


spWeb)
spWeb)


这篇关于无法创建新的Web部件页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆