我想使用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
網站同時是一個鏈接和一個鏈接組。請參閱我的回答中的更新如何向其添加子鏈接。 –