Tuesday, November 20, 2012

Delete Navigation nodes using Powershell in SharePoint 2010 QuickLaunch.

This script is used to delete the navigation nodes in the  SharePoint Quick Launch (Left side - navigation links) in the site.


if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
    Add-PSSnapin Microsoft.SharePoint.PowerShell
}


$spWeb = Get-SPWeb $siteUrl -ErrorAction Stop
Foreach($node in ($spWeb.Navigation.QuickLaunch)){
write-host "The node title is "$node.Title
$node.Delete()
}
$spWeb.Dispose()

No comments:

Post a Comment