当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 使用 PowerShell 添加指向 SharePoint 顶部导航菜单或快速启动的链接

作者:精品下载站 日期:2024-12-14 14:01:20 浏览:13 分类:玩电脑

使用 PowerShell 添加指向 SharePoint 顶部导航菜单或快速启动的链接


要求: 添加指向 SharePoint 全局导航(顶部链接栏)或使用 PowerShell 快速启动的新链接。

使用 PowerShell 添加指向 SharePoint 顶部导航的链接:

您想使用 PowerShell 添加指向 SharePoint 顶部导航或快速启动的链接吗?让我向您展示如何做到这一点:


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for processing
$WebURL="https://sharepoint.crescent.com/teams/marketing"
$NavigationTitle="Employee Profile"
$NavigationLink="https://peoplesoft.crescent.com/employee/profile.aspx"

#Get the Web
$Web= Get-SPWeb $WebURL

#Get Top Navigation
$TopNavigation = $Web.Navigation.TopNavigationBar
#For Quick Launch, Use: Navigation.QuickLaunch

#Create a New Top Navigation Node
$node = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode($NavigationTitle, $NavigationLink, $true)

#Add the Node
$TopNavigation.AddAsLast($node)

#Set the Target Property - Will work only when Publishing features is enabled
$node.Properties["Target"] = "_blank"

$node.Update

您可以更改脚本以添加指向网站集中所有网站的新链接。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯