pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

New-PnPWeb InheritNavigation option is not applying parent navigation elements #1760

Open sitwalkstand opened 5 years ago

sitwalkstand commented 5 years ago

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-SPOProvisioningTemplate or Get-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

When I run the following command the Parent site navigation is not applied to the new sub site that is created:

New-PnPWeb -Title "Project A Web" -Url projectA -Description "Information about Project A" -Locale 1033 -Template "STS#0" -InheritNavigation

Expected behavior

I am running this in a sub site and am expecting it to use the parent's global navigation. This is the parent's navigation bar:

image

Actual behavior

This is what is displayed after running the New-PnPWeb command:

image

If I go to the Site Settings -> Navigation it shows the correct option selected:

image

And if I click the "Ok" button on the Navigation settings it then correctly applies the top-level navigation:

image

I am attempting to use the New-PnPWeb command as part of an automatic site provisioning process and am hoping to avoid the manual steps of navigation the UI and having to click "Ok" to apply the global navigation.

Steps to reproduce behavior

New-PnPWeb -Title "Project A Web" -Url projectA -Description "Information about Project A" -Locale 1033 -Template "STS#0" -InheritNavigation

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

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

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable) 3.2.1810.0

How did you install the PnP-PowerShell Cmdlets?

robertcaretta commented 4 years ago

I can confirm this behavior. Not what I was expecting. I was hoping this would emulate using the GUI when clicking New -> Subsite. Using this wizard creates a subsite and adds an entry into the top navigation. This doesn't appear to do the last part. Would be nice if this would also apply an entry to root site collection top navigation as well.