Retrieving SharePoint Lists with PowerShell

The following example shows how to get a list of SharePoint lists and libraries on a SharePoint site. To display such a list, a custom function is needed:

image

The preceding function receives SPWeb as the object and then invokes the appropriate functions from SharePoint API to retrieve lists (only those available on the Quick Launch menu).

To call this function, type the following:

image

The Get-SPSite cmdlet lists all site collections (SPSite), pipes the results to Get-SPWeb that lists every site (SPWeb) within ...

Get Microsoft SharePoint 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.