I have been searching for a while but did not find anything. How can I set the style of the quick launch navigation via PowerShell?

I want to configure it from mega-menu to overlapping.

enter image description here

1 Answer 1


Try using below code:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null

$webUrl = "<site url>"
$username = "<username>@<tenant>.onmicrosoft.com"
$pw = read-host -Prompt "Enter password" -AsSecureString

$ctx= New-Object Microsoft.SharePoint.Client.ClientContext($webURL)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username,$pw)
$ctx.Web.MegaMenuEnabled = $false //Disables megamenu experience

OR: Using PnP PowerShel:

Connect-PnPOnline -Url <yoursite>
$web = Get-PnPWeb
$web.MegaMenuEnabled = $false //$false to disable, $true to enable

Source: Manage SharePoint communication site megamenu with CSOM and PowerShell

You can also use Set-PnPWeb command to set MegaMenuEnabled parameter of SharePoint web.

  • 1
    Thank you, that's it!
    – Johannes
    Jul 28, 2020 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.