Table of Contents

Set-PnPDefaultPageLayout

SYNOPSIS

Sets a specific page layout to be the default page layout for a publishing site

SYNTAX

TITLE

Set-PnPDefaultPageLayout -Title <String> [-Connection <PnPConnection>]
 

INHERIT

Set-PnPDefaultPageLayout [-InheritFromParentSite] [-Connection <PnPConnection>]
 

DESCRIPTION

Allows to set the default page layout for a publishing site.

EXAMPLES

EXAMPLE 1

Set-PnPDefaultPageLayout -Title projectpage.aspx

Sets projectpage.aspx to be the default page layout for the current web

EXAMPLE 2

Set-PnPDefaultPageLayout -Title test/testpage.aspx

Sets a page layout in a folder in the Master Page & Page Layout gallery, such as _catalog/masterpage/test/testpage.aspx, to be the default page layout for the current web

EXAMPLE 3

Set-PnPDefaultPageLayout -InheritFromParentSite

Sets the default page layout to be inherited from the parent site

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

-InheritFromParentSite

Set the default page layout to be inherited from the parent site.

Type: SwitchParameter
Parameter Sets: INHERIT

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

-Title

Title of the page layout

Type: String
Parameter Sets: TITLE

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

Microsoft 365 Patterns and Practices