Add-PnPClientSideWebPart

Adds a Client-Side Web Part to a client-side page

Syntax

Add-PnPClientSideWebPart
   -Page <ClientSidePagePipeBind>
                           -DefaultWebPartType <DefaultClientSideWebParts>
                           [-WebPartProperties <PropertyBagPipeBind>]
                           [-Order <Int>]
                           [-Web <WebPipeBind>]
                           [-Connection <SPOnlineConnection>]
Add-PnPClientSideWebPart
   -Page <ClientSidePagePipeBind>
                           -Component <ClientSideComponentPipeBind>
                           [-WebPartProperties <PropertyBagPipeBind>]
                           [-Order <Int>]
                           [-Web <WebPipeBind>]
                           [-Connection <SPOnlineConnection>]
Add-PnPClientSideWebPart
   -Page <ClientSidePagePipeBind>
                           -DefaultWebPartType <DefaultClientSideWebParts>
                           -Section <Int>
                           -Column <Int>
                           [-WebPartProperties <PropertyBagPipeBind>]
                           [-Order <Int>]
                           [-Web <WebPipeBind>]
                           [-Connection <SPOnlineConnection>]
Add-PnPClientSideWebPart
   -Page <ClientSidePagePipeBind>
                           -Component <ClientSideComponentPipeBind>
                           -Section <Int>
                           -Column <Int>
                           [-WebPartProperties <PropertyBagPipeBind>]
                           [-Order <Int>]
                           [-Web <WebPipeBind>]
                           [-Connection <SPOnlineConnection>]

Description

Adds a client-side web part to an existing client-side page.

Examples

------------------EXAMPLE 1------------------

Add-PnPClientSideWebPart -Page "MyPage" -DefaultWebPartType BingMap

Adds a built-in Client-Side component 'BingMap' to the page called 'MyPage'

------------------EXAMPLE 2------------------

Add-PnPClientSideWebPart -Page "MyPage" -Component "HelloWorld"

Adds a Client-Side component 'HelloWorld' to the page called 'MyPage'

------------------EXAMPLE 3------------------

Add-PnPClientSideWebPart  -Page "MyPage" -Component "HelloWorld" -Section 1 -Column 2

Adds a Client-Side component 'HelloWorld' to the page called 'MyPage' in section 1 and column 2

Required Parameters

-Column

Sets the column where to insert the WebPart control.

Type:Int
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Component

Specifies the component instance or Id to add.

Type:ClientSideComponentPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-DefaultWebPartType

Defines a default WebPart type to insert.

Type:DefaultClientSideWebParts
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Page

The name of the page.

Type:ClientSidePagePipeBind
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Section

Sets the section where to insert the WebPart control.

Type:Int
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Optional 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:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Order

Sets the order of the WebPart control. (Default = 1)

Type:Int
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-WebPartProperties

The properties of the WebPart

Type:PropertyBagPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False