Table of Contents

Remove-PnPPageComponent

SYNOPSIS

Removes a page component from a page.

SYNTAX

Remove-PnPPageComponent [-Page] <PagePipeBind> -InstanceId <Guid> [-Force] [-Connection <PnPConnection>]

DESCRIPTION

This cmdlet removes specified page component from a page.

EXAMPLES

EXAMPLE 1

Remove-PnPPageComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82

Removes the specified control from the page.

EXAMPLE 2

$webpart = Get-PnPPageComponent -Page "Home" | Where-Object { $_.Title -eq "Site activity" }
Remove-PnPPageComponent -Page "Home" -InstanceId $webpart.InstanceId -Force

Finds a web part with the title "Site activity" on the Home.aspx page, then removes it from the 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
Parameter Sets: (All)

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

-Force

If specified you will not receive the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

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

-InstanceId

The instance id of the component.

Type: Guid
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

Microsoft 365 Patterns and Practices