我想使用PowerShell将QuickLaunch链接添加到网站。在SharePoint网站上添加新的quicklaunch导航链接
我目前使用的脚本是:
$web = Get-SPWeb http://sp_3/Deps
$node = New-Object -TypeName Microsoft.SharePoint.Navigation.SPNavigationNode
-ArgumentList "LinkTitle", "http://sp_3/Deps/SUP"
$web.Navigation.QuickLaunch.Add($node);
$web.Update()
这将导致以下错误:
Can not find an overload for the "Add" and the number of arguments: "1." line: 1 char: 32
+ $ Web.Navigation.QuickLaunch.Add <<<< ($ node);
+ CategoryInfo: NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId: MethodCountCouldNotFindBest
我在做什么错?
好的)谢谢! '$ web = Get-SPWeb http:// sp_3/Deps $ node = New-Object -TypeName Microsoft.SharePoint.Navigation.SPNavigationNode -ArgumentList“LinkTitle”,“http:// sp_3/Deps/SUP”,1 $ web.Navigation.QuickLaunch.Add($节点); '使用此代码我得到一个胖链接到您的网站。 (现在我的链接位于快速启动栏上,很孤独) 问:我如何让标题为Sites的链接? – spbsmile
我希望你能理解我 – spbsmile
网站同时是一个链接和一个链接组。请参阅我的回答中的更新如何向其添加子链接。 –