I am creating a top nav hierarchy using Powershell. I can create the first level nodes easily enough, but second level nodes nevver get created and I get no errors from the script. Here is an example:

$web = get-spweb https://www.nga.dev
$node1 = New-Object         Microsoft.SharePoint.Navigation.SPNavigationNode("Products", "/Info/Pages/Content/ContentCatalog.aspx")

$node2 = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("Services", "/Info/Pages/Content/ServiceCatalog.aspx")

$node3 = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("Missions", "/")

$subNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("IA Missions","/")
$subNode = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode("Other Missions","/")

I also notice that I need a valid URL in order for the node to show inthe top nav bar. Is this normal?

1 Answer 1


Use the CreateSPNavigationNode method and you can pass in the collection directly:

$subNode = [Microsoft.SharePoint.Publishing.Navigation.SPNavigationSiteMapNode]::CreateSPNavigationNode("IA Missions","/",[Microsoft.SharePoint.Publishing.NodeTypes.AuthoredLinkPlain], $node3.Children)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.