Modify the Quick Launch in SharePoint Online sites using PowerShell PnP

There are some useful cmdlets in the SharePoint PowerShell PnP module that one wouldn’t think about using, but coupled with a set of other cmdlets, they can be very useful!
In today’s blog post, we’ll take the example of the Quick Launch.

We can add, remove, or even change the name of a list / library by using PowerShell. And when I said earlier coupled with other cmdlets, we’ll create lists & document libraries too!

 

At the beginning…

When we create a new Site Collection using the Team site template, the default Quick Launch looks like this:

Now maybe, just maybe, we don’t need (or don’t want) to see all of that. And because we are using PowerShell, chances are we want to do something else at the time? 🤔

OK – So let’s do this!

 

 

Modify the Quick Launch

This is what we’re going to do… :

  • Create a list
  • Create a document library
  • Add a link to my Blog (of course!)
  • Rename the default “Documents” library to “Other Docs
  • Remove Notebook, Pages, and Conversations

And those are the cmdlets we’ll use… :

How does that sound? Good? I’d hope you’d say that 😅

 

#Connect to the Site Collection
https://vmvp.sharepoint.com/sites/PnPDemoBlog

#Create list/library & add an external link to the blog!
New-PnPList -Title "Customers Details" -Template Contacts -Url "CustomersDetails" -OnQuickLaunch
New-PnPList -Title "Team Documents" -Template DocumentLibrary -Url "TeamDocuments" -OnQuickLaunch
Add-PnPNavigationNode -Title "V's Blog!" -Url "https://veronicageek.com" -Location QuickLaunch -First -External

#Rename the default Document Library
Set-PnPList -Identity "Documents" -Title "Other Docs"

#Remove from the Quick Launch
Remove-PnPNavigationNode -Title "Notebook" -Location QuickLaunch -Force
Remove-PnPNavigationNode -Title "Pages" -Location QuickLaunch -Force
Remove-PnPNavigationNode -Title "Conversations" -Location QuickLaunch -Force

 

Tada! 💪

 

Of course, for each cmdlet you have other parameters to choose from. Just go explore!

 

Leave a Reply

%d bloggers like this: