Get-PnPList

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Get-PnPList.md to change this file.

Returns lists from SharePoint

Syntax

Get-PnPList
   [[-Identity] <ListPipeBind>]
   [-ThrowExceptionIfListNotFound]
    [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]

Examples

EXAMPLE 1

Get-PnPList

Returns all lists in the current web

EXAMPLE 2

Get-PnPList -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

Returns a list with the given id

EXAMPLE 3

Get-PnPList -Identity Lists/Announcements

Returns a list with the given url

EXAMPLE 4

Get-PnPList | Where-Object {$_.RootFolder.ServerRelativeUrl -like "/lists/*"}

This examples shows how to do wildcard searches on the list URL. It returns all lists whose URL starts with "/lists/" This could also be used to search for strings inside of the URL.

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:PnPConnection
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

The ID, name or Url (Lists/MyList) of the list

Type:ListPipeBind
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ThrowExceptionIfListNotFound

Switch parameter if an exception should be thrown if the requested list does not exist (true) or if omitted, nothing will be returned in case the list does not exist

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False