Hide SharePoint list from Site Contents
Summary
If you need to hide the SharePoint list from the UI this simple PowerShell script will hide a specific list from the site contents. This will prevent users from easily accessing the list while, for example, you are still setting it up.
# SharePoint online site url
$siteUrl = "https://contoso.sharepoint.com/sites/SPConnect"
# Display name of SharePoint online list
$listName = "My List"
# Connect to SharePoint online site
Connect-PnPOnline -url $siteUrl -Interactive
# Hide SharePoint online list from Site Contents
Set-PnPList -Identity $listName -Hidden $true
# Disconnect SharePoint online connection
Disconnect-PnPOnline
Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell
The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?
Contributors
Author(s) |
---|
Leon Armston |
Ganesh Sanap |
Disclaimer
THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.