Table of Contents

Set-PnPPageWebPart

SYNOPSIS

Sets web part properties.

SYNTAX

Set-PnPPageWebPart -Page <PagePipeBind> -Identity <WebPartPipeBind>
 [-Title <String>] [-PropertiesJson <String>] [-Connection <PnPConnection>]
 

DESCRIPTION

Sets specific client side web part properties. Notice that the title parameter will only set the -internal- title of web part. The title which is shown in the UI will, if possible, have to be set using the PropertiesJson parameter. Use Get-PnPPageComponent to retrieve the instance id and properties of a web part.

EXAMPLES

EXAMPLE 1

Set-PnPPageWebPart -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson "`"Property1`"=`"Value1`""

Sets the properties of the client side web part.

EXAMPLE 2

Set-PnPPageWebPart -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties

Sets the properties of the client side web part given in the $myproperties variable.

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
Parameter Sets: (All)

Required: False
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 instance id or the title of a web part.

Type: WebPartPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Page

The name of the page.

Type: PagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-PropertiesJson

Sets the properties as a JSON string.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Title

Sets the internal title of the web part. Notice that this will NOT set a visible title.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

Microsoft 365 Patterns and Practices