Contents

Modify the quick launch in SharePoint using PowerShell

 

There are some useful cmdlets in the PnP PowerShell 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:

/images/powershell-screenshots/modify-quick-launch-img1.png
 

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 hoped you’d say that 😅
 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#Connect to the Site Collection
https://<TENANT-NAME>.sharepoint.com/sites/<YOUR-SITE>

#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!

/images/powershell-screenshots/modify-quick-launch-img2.png