Forum Discussion
Copy/Export Navigation?
Saeid_Abdollahzadeh - I just tried your module after making a couple modifications and it worked great. Updated changes needed where:
- Replace -UseWebLogin with -Interactive (so it supports MFA login)
- Replace SharePointPnPPowerShellOnline with PnP.Powershell
I'm new to Github, so not sure if i did this right, but made the corrections in fork at
Comparing saeid-adz:master...robert-studio365:patch-1 ยท saeid-adz/Copy-PNPNavigation (github.com)
Also took me awhile to figure this out, but using "-NavigationLocation QuickLaunch" instead of "-NavigationLocation TopNavigationBar" also worked great with this module.
Thanks for sharing.
@Saeid_Abdollahzadeh - one correction. The first half of the script that copies all the QuickLaunch nav menus to an excel works perfectly. After that there are two problems:
- It doesn't seem to be copying the MenuURL to the target site. And even if it didn't error out, in the spreadsheet the URL is being saved as "sites/SOURCESITE/Sitepages...". Possible to modify the script so that when writing to the new site it updates that relative reference?
- It's generating an error of "Add-PnPNavigationNode: Object reference not set to an instance of an object.".
If you have a chance to update this, that would be greatly appreciated. Thank you.