powershell - 在SharePoint网站上添加新的快速启动导航链接

标签 powershell sharepoint navigation

我想使用Powershell将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

我究竟做错了什么?

最佳答案

啊! This page具有最出色的教程和示例。这是对我有用的东西(SP 2010)

$quickLaunch = $currentWeb.navigation.quicklaunch
$libheading = $quickLaunch | where { $_.Title -eq "Libraries" }
$newnode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode($whattitle, $myurllink, $true)
$libheading.Children.AddAsLast($newnode)
$currentweb.update()

关于powershell - 在SharePoint网站上添加新的快速启动导航链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10545991/

相关文章:

javascript - 如何在 <div> HERE <div/> 中循环

powershell - 混合 Where-Object/ForEach-Object 语法

vb.net - 在哪里可以下载 Sharepoint DLL

ios - 多个segues删除 View Controller 中的导航栏

javascript - Angular 4 + zonejs : routing stops working after uncaught error

azure - 如何在 powershell 中规范化此 URL?

json - 如何将此 JSON 往返传输到 PSObject 并返回到 Powershell

sharepoint - 如何将 SharePoint 2010 列表表单从 InfoPath 重置为默认表单?

sharepoint - 使用 PowerShell 从 SharePoint 获取用户详细信息

ios - 确定 MKRoutestep 何时完成