Table of contents
TOC
Collapse the table of content
Expand the table of content

Add-PnPNavigationNode

Bert Jansen|Last Updated: 2/20/2017
|
1 Contributor

Adds a menu item to either the quicklaunch or top navigation

Syntax

Add-PnPNavigationNode -Location <NavigationType>
                      -Title <String>
                      [-Url <String>]
                      [-Header <String>]
                      [-First [<SwitchParameter>]]
                      [-External [<SwitchParameter>]]
                      [-Web <WebPipeBind>]

Parameters

ParameterTypeRequiredDescription
LocationNavigationTypeTrueThe location of the node to add. Either TopNavigationBar, QuickLaunch or SearchNav
TitleStringTrueThe title of the node to add
ExternalSwitchParameterFalseIndicates the destination URL is outside of the site collection.
FirstSwitchParameterFalseAdd the new menu item to beginning of the collection.
HeaderStringFalseOptionally value of a header entry to add the menu item to.
UrlStringFalseThe url to navigate to when clicking the new menu item.
WebWebPipeBindFalseThe web to apply the command to. Omit this parameter to use the current web.

Examples

Example 1

PS:> Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch"

Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso" and will link to the url "http://contoso.sharepoint.com/sites/contoso/"

Example 2

PS:> Add-PnPNavigationNode -Title "Contoso USA" -Url "http://contoso.sharepoint.com/sites/contoso/usa/" -Location "QuickLaunch" -Header "Contoso"

Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso USA", will link to the url "http://contoso.sharepoint.com/sites/contoso/usa/" and will have "Contoso" as a parent navigation node.

Example 3

PS:> Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch" -First

Adds a navigation node to the quicklaunch, as the first item. The navigation node will have the title "Contoso" and will link to the url "http://contoso.sharepoint.com/sites/contoso/"

Example 4

PS:> Add-PnPNavigationNode -Title "Contoso Pharmaceuticals" -Url "http://contoso.sharepoint.com/sites/contosopharma/" -Location "QuickLaunch" -External

Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso Pharmaceuticals" and will link to the external url "http://contoso.sharepoint.com/sites/contosopharma/"

© 2017 Microsoft