Add-PnPNavigationNode

Adds an item to a navigation element

Syntax

Add-PnPNavigationNode
   -Location <NavigationType>
                        -Title <String>
                        [-Url <String>]
                        [-Parent <Int>]
                        [-First [<SwitchParameter>]]
                        [-External [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <SPOnlineConnection>]

Description

Adds a menu item to either the quicklaunch or top navigation

Examples

------------------EXAMPLE 1------------------

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------------------

Add-PnPNavigationNode -Title "Contoso USA" -Url "http://contoso.sharepoint.com/sites/contoso/usa/" -Location "QuickLaunch" -Parent 2012

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 the node with id 2012 as a parent navigation node.

------------------EXAMPLE 3------------------

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------------------

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/"

------------------EXAMPLE 5------------------

Add-PnPNavigationNode -Title "Wiki" -Location "QuickLaunch" -Url "wiki/"

Adds a navigation node to the quicklaunch. The navigation node will have the title "Wiki" and will link to Wiki library on the selected Web.

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-External

Indicates the destination URL is outside of the site collection.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-First

Add the new menu item to beginning of the collection.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Location

The location of the node to add. Either TopNavigationBar, QuickLaunch, SearchNav

Type:NavigationType
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Parent

The key of the parent. Leave empty to add to the top level

Type:Int
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Title

The title of the node to add

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Url

The url to navigate to when clicking the new menu item. This can either be absolute or relative to the Web. Fragments are not supported.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.SharePoint.Client.NavigationNode