I am building the navigation for a hub site in SharePoint Online using PowerShell and I want some of my links to be headers only (not URL).
I am using the following Powershell commands to create my navigation nodes:
To create a menu item with a hyperlink I use: Add-PnPNavigationNode -Title "Menu 1" -Url "" -Location TopNavigationBar
I am trying to create one without a link (so just a header) and I tried:
Add-PnPNavigationNode -Title "Menu 2" -Url "" -Location TopNavigationBar -Parent 123 # empty Url paramter
Add-PnPNavigationNode -Title "Menu 2" -Location TopNavigationBar -Parent 123 # no Url parameter
Both options are creating a menu item with a link to the hub home page.
Note that if I edit the links through the UI I can change it from URL to Header.
Any idea how I can create a Header item in the top navigation?
Thanks