I am working on a PowerShell script to provision a site collection with a predefined hierarchy. Since the PowerShell breadth is so limited, most of this is done via functions that are CSOM code.
As part of this, I need to have a unified global navigation. I have been able to enable the publishing feature without problems. My issues arise when I have to step through each site and set the global navigation settings to:
- Use structural navigation on the Rootweb, including subsites
- In each subsite, inherit from the parent, and include subsites.
I have seen a lot of this floating around for on-prem like Powershell script to update Navigation.GlobalIncludeSubSites not applying changePowershell script to update Navigation.GlobalIncludeSubSites not applying change, I need it to work for Office 365. I can't seem to get a right handle on the publishing web and the navigation settings.
Does anyone have a definitive example or a reference to how to modify the current navigation via CSOM in PowerShell for Office 365?