We are doing bulk network share drive migrations into SharePoint. The SPO Migration tool automatically creates the document library, but does not automatically add it to the Quick Launch.

There does not seem to be a setting to add it automatically from the 'Site Contents' when created, but hopefully there is a simple PowerShell script that can do it.

Thanks for any assistance.

enter image description here

1 Answer 1


You can add a document library to SharePoint Online navigation using below PnP PowerShell script:

#Config Variables
$SiteURL = "https://crescent.sharepoint.com/sites/retail"
$LibraryName = "Documents"
#Connect to the Site
Connect-PnPOnline -URL $SiteURL -Interactive
#Get the Library
$Library = Get-PnPList -Identity $LibraryName
$Library.OnQuickLaunch =  $true
  • Hi Ganesh. Yes, this will work, but it does require manually adding every single document Library name into the script. Given I batch 11 SPO sites at a time and each one will have 10 to 20 document libraries, I was hoping to find a script that looks in the 'Site Contents' to get the library names. Otherwise, I may as well keep doing it the manual way - Library by Library. Thanks anyway.
    – Scott
    Commented Feb 3, 2023 at 5:03
  • You can get all document libraries using: $DocumentLibraries = Get-PnPList | Where-Object {$_.BaseTemplate -eq 101 -and $_.Hidden -eq $false} #Or $_.BaseType -eq "DocumentLibrary" and then loop on the results to add it in quick launch. Commented Feb 3, 2023 at 6:47
  • 1
    Thank you Ganesh - you have been most helpful
    – Scott
    Commented Feb 8, 2023 at 23:39
  • You're welcome. Glad it helped you! Commented Feb 9, 2023 at 6:50

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.