ConvertTo-PnPClientSidePage

Converts a classic page (wiki or web part page) into a Client-Side Page

Syntax

ConvertTo-PnPClientSidePage
         -Identity <PagePipeBind>
                                    [-WebPartMappingFile <String>]
                                    [-Overwrite [<SwitchParameter>]]
                                    [-TakeSourcePageName [<SwitchParameter>]]
                                    [-ReplaceHomePageWithDefault [<SwitchParameter>]]
                                    [-AddPageAcceptBanner [<SwitchParameter>]]
                                    [-SkipItemLevelPermissionCopyToClientSidePage [<SwitchParameter>]]
                                    [-ClearCache [<SwitchParameter>]]
                                    [-CopyPageMetadata [<SwitchParameter>]]
                                    [-UseCommunityScriptEditor [<SwitchParameter>]]
                                    [-SummaryLinksToHtml [<SwitchParameter>]]
                                    [-TargetWebUrl <String>]
                                    [-Web <WebPipeBind>]
                                    [-Connection <SPOnlineConnection>]

Examples

------------------EXAMPLE 1------------------

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite

Converts a wiki page named 'somepage' to a client side page

------------------EXAMPLE 2------------------

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -WebPartMappingFile c:\contoso\webpartmapping.xml

Converts a wiki page named 'somepage' to a client side page using a custom provided mapping file

------------------EXAMPLE 3------------------

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -AddPageAcceptBanner

Converts a wiki page named 'somepage' to a client side page and adds the page accept banner web part on top of the page. This requires that the SPFX solution holding the web part (https://github.com/SharePoint/sp-dev-modernization/blob/master/Solutions/PageTransformationUI/assets/sharepointpnp-pagetransformation-client.sppkg?raw=true) has been installed to the tenant app catalog.

------------------EXAMPLE 4------------------

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -CopyPageMetadata

Converts a wiki page named 'somepage' to a client side page, including the copying of the page metadata (if any)

------------------EXAMPLE 5------------------

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetmodernsite

Converts a wiki page named 'somepage' to a client side page in the https://contoso.sharepoint.com/sites/targetmodernsite site

Parameters

-AddPageAcceptBanner

Adds the page accept banner web part. The actual web part is specified in webpartmapping.xml file

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ClearCache

Clears the cache. Can be needed if you've installed a new web part to the site and want to use that in a custom webpartmapping file. Restarting your PS session has the same effect.

Type:SwitchParameter
Position:Named
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:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-CopyPageMetadata

Copies the page metadata to the created modern page.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Identity

The name of the page to convert

Type:PagePipeBind
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Overwrite

Overwrites page if already existing

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ReplaceHomePageWithDefault

Replaces a home page with a default stock modern home page

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-SkipItemLevelPermissionCopyToClientSidePage

By default the item level permissions on a page are copied to the created client side page. Use this switch to prevent the copy.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-SummaryLinksToHtml

By default summarylinks web parts are replaced by QuickLinks, but you can transform to plain html by setting this switch.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-TakeSourcePageName

Created client side page takes name from previous classic page. Classic page gets renamed to previous_<Page>.aspx

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-TargetWebUrl

Url of the target web that will receive the modern page. Defaults to null which means in-place transformation.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-UseCommunityScriptEditor

Uses the community script editor (https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor) as replacement for the classic script editor web part.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-WebPartMappingFile

Path and name of the web part mapping file driving the transformation

Type:String
Position:Named
Accept pipeline input:True
Accept wildcard characters:False