PowerShell Update Current Navigation in SharePoint

Using PowerShell, you can update SharePoint navigation items.
Example for: Display only the navigation items below the current site

$SiteCollection = Get-SPSite "http://taco/SiteCollection/"

foreach ($subSite in $SiteCollection.AllWebs)
	{
		$updateSite = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($subSite)
		$updateSite.Navigation.InheritCurrent = $false
		$updateSite.Navigation.ShowSiblings = $false
		$subSite.Dispose()
	}
	
$SiteCollection.Dispose()

Leave a Reply

Your email address will not be published. Required fields are marked *