Add-PnPPageWebPart

Tip

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

Adds a web part to a page

Syntax

Add-PnPPageWebPart
   [-Page] <PagePipeBind>
   -DefaultWebPartType <DefaultClientSideWebParts>
   [-WebPartProperties <PropertyBagPipeBind>]
   [-Order <Int32>]
   [-Connection <PnPConnection>]
   [<CommonParameters>]
Add-PnPPageWebPart
   [-Page] <PagePipeBind>
   -Component <PageComponentPipeBind>
   [-WebPartProperties <PropertyBagPipeBind>]
   [-Order <Int32>]
   [-Connection <PnPConnection>]
   [<CommonParameters>]
Add-PnPPageWebPart
   [-Page] <PagePipeBind>
   -DefaultWebPartType <DefaultClientSideWebParts>
   [-WebPartProperties <PropertyBagPipeBind>]
   [-Order <Int32>]
   -Section <Int32>
   -Column <Int32>
   [-Connection <PnPConnection>]
   [<CommonParameters>]
Add-PnPPageWebPart
   [-Page] <PagePipeBind>
   -Component <PageComponentPipeBind>
   [-WebPartProperties <PropertyBagPipeBind>]
   [-Order <Int32>]
   -Section <Int32>
   -Column <Int32>
   [-Connection <PnPConnection>]
   [<CommonParameters>]

Description

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

Examples

EXAMPLE 1

Add-PnPPageWebPart -Page "MyPage" -DefaultWebPartType BingMap

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

EXAMPLE 2

Add-PnPPageWebPart -Page "MyPage" -Component "HelloWorld"

Adds a component 'HelloWorld' to the page called 'MyPage'

EXAMPLE 3

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

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

Parameters

-Column

Sets the column where to insert the web part control.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Component

Specifies the component instance or Id to add.

Type:PageComponentPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-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
-DefaultWebPartType

Defines a default web part type to insert.

Type:DefaultClientSideWebParts
Accepted values:ThirdParty, ContentRollup, BingMap, ContentEmbed, DocumentEmbed, Image, ImageGallery, LinkPreview, NewsFeed, NewsReel, News, PowerBIReportEmbed, QuickChart, SiteActivity, VideoEmbed, YammerEmbed, Events, GroupCalendar, Hero, List, PageTitle, People, QuickLinks, CustomMessageRegion, Divider, MicrosoftForms, Spacer, ClientWebPart, PowerApps, CodeSnippet, PageFields, Weather, YouTube, MyDocuments, YammerFullFeed, CountDown, ListProperties, MarkDown, Planner, Sites, CallToAction, Button
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Order

Sets the order of the web part control. (Default = 1)

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Page

The name of the page.

Type:PagePipeBind
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Section

Sets the section where to insert the web part control.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WebPartProperties

The properties of the web part

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