Monday, August 29, 2011

Sharepoint 2010: Update SPNavigationNode Title

as per my requirement i need to update "Library" node to "Libraries"

Namespace:  Microsoft.SharePoint.Publishing.Navigation
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

here is the Powershell Script :
public static SPNavigationNode UpdateSPNavigationNode(
         SPNavigationNode node,
         SPNavigationNode previous,
         string name,
         string url,
         string description,
         string target,
         string audience,
         bool forceCreate

$web=Get-SPWeb $webURL
$LibraryNode = $navigationNode | where { $_.Title -eq "Library" }
$HomeNode= $navigationHomeNode | where { $_.Title -eq "Home" }
$NewTitle= "Libraries"
[Microsoft.SharePoint.Publishing.Navigation.SPNavigationSiteMapNode]::UpdateSPNavigationNode($LibraryNode, $HomeNode, $NewTitle, $LibraryNode.Url, "", "", "", $false)

No comments:

Post a Comment


Blog Archive