Last active
October 24, 2019 14:58
-
-
Save jcallaghan/473609e5b0582ab862f83e1ba964ab60 to your computer and use it in GitHub Desktop.
Remove links from the quick launch in classic SharePoint Team sites. See https://jcallaghan.com/2011/10/clear-the-sharepoint-quick-launch-using-powershell/ for more information. #Website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Remove-SPQuickLaunchLinks{ | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$url | |
) | |
$SPWeb = Get-SPWeb $url | |
$QuickLaunch = $SPWeb.Navigation.QuickLaunch | |
$Nodes = @() | |
$QuickLaunch | ForEach-Object { | |
$Nodes = $Nodes + $_.Id | |
} | |
$Nodes | ForEach-Object { | |
$Node = $SPWeb.Navigation.GetNodeById($_) | |
$Node.Delete() | |
} | |
$SPWeb.Dispose() | |
} | |
Remove-SPQuickLaunchLinks -url "https://sharepoint.jcallaghan.com/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment