pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets

Home Page:https://pnp.github.io/powershell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Add-PnPNavigationNode Adds unwanted / to URL

Peelay opened this issue · comments

Reporting an Issue or Missing Feature

Running the following:
Add-PnPNavigationNode -Title "Home" -Url "/sites/TestSite" -Location "QuickLaunch" -First

Expected behavior

Should create a link with ahref="https://tenant.sharepoint.com/sites/TestSite"

Actual behavior

Results in a link with ahref="https://tenant.sharepoint.com/sites/TestSite/"
A trailing slash is added and this can't be removed.

If this was the standard it wouldn't be an issue but when you create a new SP Site the QuickLaunch Home link has no trailing slash. The only way to control order is to use -First and if you want Home to remain first you have to remove it then re-add everything in reverse order using -First. When re-adding Home link it now has trailing slash making it inconsistent with default navigation of a new site.

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

3.25.20

How did you install the PnP-PowerShell Cmdlets?

  • Installed through the PowerShell Gallery with Install-Module

The trailing slash is generally a convention these days. I'm not sure this could be considered a bug. Is there any adverse outcome based on this?