Get-PnPWebPart

Tip

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

Returns a web part definition object

Syntax

Get-PnPWebPart
   -ServerRelativePageUrl <String>
   [-Identity <WebPartPipeBind>]
    [-Connection <PnPConnection>]
   [<CommonParameters>]

Examples

EXAMPLE 1

Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx"

Returns all webparts defined on the given page.

EXAMPLE 2

Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82

Returns a specific web part defined on the given page.

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 identity of the web part, this can be the web part guid or a web part object

Type:WebPartPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ServerRelativePageUrl

Full server relative URL of the web part page, e.g. /sites/mysite/sitepages/home.aspx

Type:String
Aliases:PageUrl
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False