Set-PnPPage

Tip

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

Sets parameters of a page

Syntax

Set-PnPPage
   [-Identity] <PagePipeBind>
   [-Name <String>]
   [-Title <String>]
   [-LayoutType <PageLayoutType>]
   [-PromoteAs <PagePromoteType>]
   [-CommentsEnabled]
   [-Publish]
   [-HeaderType <PageHeaderType>]
   [-HeaderLayoutType <PageHeaderLayoutType>]
   [-ContentType <ContentTypePipeBind>]
   [-ThumbnailUrl <String>]
   [-Connection <PnPConnection>]
   [<CommonParameters>]

Examples

EXAMPLE 1

Set-PnPPage -Identity "MyPage" -LayoutType Home -Title "My Page"

Updates the properties of the page named 'MyPage'

EXAMPLE 2

Set-PnPPage -Identity "MyPage" -CommentsEnabled

Enables the comments on the page named 'MyPage'

EXAMPLE 3

Set-PnPPage -Identity "MyPage" -CommentsEnabled:$false

Disables the comments on the page named 'MyPage'

EXAMPLE 4

Set-PnPPage -Identity "MyPage" -HeaderType Default

Sets the header of the page to the default header

EXAMPLE 5

Set-PnPPage -Identity "MyPage" -HeaderType None

Removes the header of the page

EXAMPLE 6

Set-PnPPage -Identity "MyPage" -HeaderType Custom -ServerRelativeImageUrl "/sites/demo1/assets/myimage.png" -TranslateX 10.5 -TranslateY 11.0

Sets the header of the page to custom header, using the specified image and translates the location of the image in the header given the values specified

Parameters

-CommentsEnabled

Enables or Disables the comments on the page

Type:SwitchParameter
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
-ContentType

Specify either the name, ID or an actual content type.

Type:ContentTypePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HeaderLayoutType

Sets the page header layout type

Type:PageHeaderLayoutType
Accepted values:None, Default, Custom
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HeaderType

Sets the page header type

Type:PageHeaderType
Accepted values:None, Default, Custom
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

The name/identity of the page

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

Sets the layout type of the page. (Default = Article)

Type:PageLayoutType
Accepted values:Article, Home, SingleWebPartAppPage, RepostPage, HeaderlessSearchResults, Spaces, Topic
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Sets the name of the page.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PromoteAs

Allows to promote the page for a specific purpose (None | HomePage | NewsArticle | Template)

Type:PagePromoteType
Accepted values:None, HomePage, NewsArticle, Template
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Publish

Publishes the page once it is saved.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ThumbnailUrl

Thumbnail Url

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Title

Sets the title of the page.

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