在Power Shell中获取错误 [英] Getting Error in Power Shell
问题描述
使用Power Shell在发布网站的Webpart区域内添加Modern WebPart时出错。
command:
> Add-PnPWebPartToWebPartPage -ServerRelativePageUrl" / sites / DemoPublishingSite / Pages / TestNews。 ASPX" -Xml $ webpartXML -ZoneId" Zone 1"
-ZoneIndex 0
错误:
Add-PnPWebPartToWebPartPage:术语"Add-PnPWebPartToWebPartPage"未被识别为cmdlet,函数,脚本文件或可操作程序的名称。
检查s
$
推销名称,或者如果包含路径,请验证路径是否正确并重试。
at line:1 char:28
+ Add-PnPWebPartToWebPartPage<<<< -ServerRelativePageUrl" /sites/DemoPublishingSite/Pages/TestNews.aspx" -Xml $ webpartXML
-ZoneId" Zone 1" -ZoneIndex 0
  ; &NBSP; + CategoryInfo &NBSP; &NBSP; &NBSP; &NBSP; :ObjectNotFound:(Add-PnPWebPartToWebPartPage:String)[],CommandNotFoundException
&NBSP; + FullyQualifiedErrorId:CommandNotFoundException
Thanks,
Balaram
< span style ="color:#1F497D">嗨 ,
错误显示您没有安装sharepoint-pnp模块。
你可以从下面获取它,然后安装它。
https://github.com/ sharepoint / pnp-powershell / releases
最好的问候,
利跨度>
Getting error while adding Modern WebPart inside Webpart Zone of a publishing site by using Power Shell.
command:
>Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/DemoPublishingSite/Pages/TestNews.aspx" -Xml $webpartXML -ZoneId "Zone 1" -ZoneIndex 0
Error:
Add-PnPWebPartToWebPartPage : The term 'Add-PnPWebPartToWebPartPage' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the s
pelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:28
+ Add-PnPWebPartToWebPartPage <<<< -ServerRelativePageUrl "/sites/DemoPublishingSite/Pages/TestNews.aspx" -Xml $webpartXML
-ZoneId "Zone 1" -ZoneIndex 0
+ CategoryInfo : ObjectNotFound: (Add-PnPWebPartToWebPartPage:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Thanks,
Balaram
Hi,
The error shows you don’t install the sharepoint-pnp module.
You could get it from below and then installing it.
https://github.com/sharepoint/pnp-powershell/releases
Best Regards,
Lee
这篇关于在Power Shell中获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!