Remove-PnPNavigationNode

Removes a menu item from either the quicklaunch or top navigation

Syntax

Remove-PnPNavigationNode
      -Identity <NavigationNodePipeBind>
                              [-Force [<SwitchParameter>]]
                              [-Web <WebPipeBind>]
                              [-Connection <SPOnlineConnection>]
Remove-PnPNavigationNode
      -All [<SwitchParameter>]
                              [-Force [<SwitchParameter>]]
                              [-Web <WebPipeBind>]
                              [-Connection <SPOnlineConnection>]

Examples

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

Remove-PnPNavigationNode -Identity 1032

Removes the navigation node with the specified id

------------------EXAMPLE 2------------------

$nodes = Get-PnPNavigationNode -QuickLaunch
PS:>$nodes | Select-Object -First 1 | Remove-PnPNavigationNode -Force

Retrieves all navigation nodes from the Quick Launch navigation, then removes the first node in the list and it will not ask for a confirmation

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

Remove-PnPNavigationNode -Title Recent -Location QuickLaunch

Will remove the recent navigation node from the quick launch in the current web.

------------------EXAMPLE 4------------------

Remove-PnPNavigationNode -Title Home -Location TopNavigationBar -Force

Will remove the home navigation node from the top navigation bar without prompting for a confirmation in the current web.

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

Remove-PnPNavigationNode -Location QuickLaunch -All

Will remove all the navigation nodes from the quick launch bar in the current web.

Parameters

-All

Specifying the All parameter will remove all the nodes from specified Location.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-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
-Force

Specifying the Force parameter will skip the confirmation question.

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

The Id or node object to delete

Type:NavigationNodePipeBind
Position:0
Accept pipeline input:True
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