PowerShell to Bulk Add Lists and Libraries to SharePoint’s Quick Launch

Someone created a bunch of lists and libraries in a new site, and then a few days later wondered why they were no longer in Quick Launch. They had seen them there the day before in the “Recent” section.

I told them the steps to edit the properties of each list to add them to Quick Launch, and then they told me that there are over 30 lists. So… PowerShell to the rescue!  Here’s the on-prem version:

$site = Get-SPSite http://sp2016/sites/calcdemo

$web = $site.RootWeb     #or which ever web is needed

$lists = $web.Lists

$lists | where {-not $_.Hidden -and $_.Created -gt (Get-Date 12/21/2017)} |
           foreach { $_.OnQuickLaunch = $true; $_.Update() }


All done!

I filtered by date so that I would not change any lists that existed before their new work, and filtered by Hidden to exclude the SharePoint auto-generated lists.

No comments:

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.