Table of contents
TOC
Collapse the table of content
Expand the table of content

Set-PnPMasterPage

Bert Jansen|Last Updated: 2/20/2017
|
1 Contributor

Sets the default master page of the current web.

Syntax

Set-PnPMasterPage [-MasterPageServerRelativeUrl <String>]
                  [-CustomMasterPageServerRelativeUrl <String>]
                  [-Web <WebPipeBind>]
Set-PnPMasterPage [-MasterPageSiteRelativeUrl <String>]
                  [-CustomMasterPageSiteRelativeUrl <String>]
                  [-Web <WebPipeBind>]

Parameters

ParameterTypeRequiredDescription
CustomMasterPageServerRelativeUrlStringFalseSpecifies the custom Master page URL based on the server relative URL
CustomMasterPageSiteRelativeUrlStringFalseSpecifies the custom Master page URL based on the site relative URL
MasterPageServerRelativeUrlStringFalseSpecifies the Master page URL based on the server relative URL
MasterPageSiteRelativeUrlStringFalseSpecifies the Master page URL based on the site relative URL
WebWebPipeBindFalseThe web to apply the command to. Omit this parameter to use the current web.

Examples

Example 1

PS:> Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master

Sets the master page based on a server relative URL

Example 2

PS:> Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master -CustomMasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master

Sets the master page and custom master page based on a server relative URL

Example 3

PS:> Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master

Sets the master page based on a site relative URL

Example 4

PS:> Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master -CustomMasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master

Sets the master page and custom master page based on a site relative URL

© 2017 Microsoft