You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/transform/modernize-userinterface-site-pages-powershell.md
+11-14Lines changed: 11 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -13,31 +13,28 @@ ms.prod: sharepoint
13
13
The page transformation engine can also be used from PowerShell. This allows it to be integrated in a site modernization script that besides page transformation also does other things like installing solution, connecting the site to an Office 365 group and applying tenant branding. A good example of an all-up modernization script can be found [in the Office 365 Group connect article](modernize-connect-to-office365-group.md).
14
14
15
15
> [!IMPORTANT]
16
-
> To use PowerShell it's important to have all the needed binaries together in one folder. The easiest solution is to download the latest version and all dependencies from the shared [SharePointPnP.Modernization binary package](https://github.com/SharePoint/sp-dev-modernization/blob/master/Tools/SharePoint.Modernization/Scripts/PageTransformation/SharePointPnP.Modernization.v1.0.1811.2%20binaries.zip?raw=true). Another way to get this list of binaries is to use Visual Studio, add the [SharePointPnPModernizationOnline](https://www.nuget.org/packages/SharePointPnPModernizationOnline) package and build the solution. Once that's done you can find the needed binaries in the solution's bin folder.
16
+
> Below scripts shows how to transform pages. It requires [PnP PowerShell](https://aka.ms/sppnp-powershell) version 3.4.1812.0 (December 2018 release) or higher.
17
17
18
-
Below script shows how to call the transformation engine using [PnP PowerShell](http://aka.ms/sppnp-powershell):
18
+
[!code-powershell[transformpages](../../sp-dev-modernization/Scripts/PageTransformation/TransformPageSample.ps1"Transform pages to modern pages using PowerShell")]
19
19
20
-
[!code-powershell[transformpages](../../sp-dev-modernization/Scripts/PageTransformation/TransformPageSampleBasic.ps1"Transform pages to modern pages using PowerShell")]
20
+
## Options for the ConvertTo-PnPClientSidePage cmdlet
21
21
22
-
## Options for the Invoke-PnPModernizationPageTransformation cmdlet
23
-
24
-
The **Invoke-PnPModernizationPageTransformation** cmdlet is the key cmdlet to modernize a given page. Below table lists the command line parameters that you can use to control the page transformation via this cmdlet.
22
+
The **ConvertTo-PnPClientSidePage** cmdlet is the key cmdlet to modernize a given page. Below table lists the command line parameters that you can use to control the page transformation via this cmdlet.
25
23
26
24
Parameter | Default | Description
27
25
----------|---------|------------
28
-
Page (*) | | The page in the format of a ListItem that will need to be transformed
29
-
WebPartMappingFile (*) | | Page transformation is driven by a mapping file. The earlier explained approaches to get the needed binaries will also give you the default web part mapping file (`webpartmapping.xml`) which you can reference and optionally tweak. to fit your page transformation needs (e.g. transforming to 3rd party custom web parts).
30
-
Overwrite | $false | When you configure `Overwrite = $true` then the page transformation framework will overwrite the target page if needed. By default the new page name has a prefix of Migrated_, which then implies that if Migrated_YourPage.aspx already exists (typically from a previous page transformation effort) it will be overwritten.
31
-
AddPageAcceptBanner | $false | Setting this option will make the page transformation framework put the configured PageAcceptBanner web part on top of the created modern page. Using this web part the users accessing the page can decide whether they want to keep or discard the created modern page. See the [Page Transformation UI](modernize-userinterface-site-pages-ui.md) article to learn more on how to install and configure the default page banner web part.
32
-
HandleWikiImagesAndVideos | $true | A wiki page can contain embedded video and text which is not possible in a modern text part. By default the wiki text will be split at each embedded image or video, a video or image web part will be added to the modern page and then the remainder of the original text. If you don't like this automatic fixing you can set this option to false which will result in each embedded image and video being replaced by a text placeholder combined with individual video and image web pars at the bottom of the page.
33
-
ReplaceHomePageWithDefaultHomePage | $false | The default behavior is to transform your site's home page to a modern page like any other regular page. If you set this option to true then a site's home page will be transformed to a 'default' out-of-the-box modern home page, so the one you would get with a newly created modern team site.
34
-
TargetPageTakesSourcePageName | $false | The default behavior is to give the created modern page a name that starts with the prefix Migrated_ and let the original page keep it's existing name. When this option is specified the newly created page gets the name of the original page and the original page is renamed with a prefix Previous_. Set this option if you're sure you want to move forward with the modern page as it will ensure that all links pointing the original page now result in the new modern page being loaded.
26
+
Identity (*) | | The page name (e.g. pageA.aspx)
27
+
WebPartMappingFile | | Page transformation is driven by a mapping file. The cmdlet has a default mapping file embedded, but you can also specify your custom web part mapping file (`webpartmapping.xml`) to fit your page transformation needs (e.g. transforming to 3rd party custom web parts). You do this by specifying the path to the file via the `-WebPartMappingFile` parameter.
28
+
Overwrite | $false | When you add `-Overwrite` then the page transformation framework will overwrite the target page if needed. By default the new page name has a prefix of Migrated_, which then implies that if Migrated_YourPage.aspx already exists (typically from a previous page transformation effort) it will be overwritten.
29
+
AddPageAcceptBanner | $false | Using `-AddPageAcceptBanner` will make the page transformation framework put the configured PageAcceptBanner web part on top of the created modern page. Using this web part the users accessing the page can decide whether they want to keep or discard the created modern page. See the [Page Transformation UI](modernize-userinterface-site-pages-ui.md) article to learn more on how to install and configure the default page banner web part.
30
+
ReplaceHomePageWithDefault | $false | The default behavior is to transform your site's home page to a modern page like any other regular page. If you use `-ReplaceHomeWithDefault` then a site's home page will be transformed to a 'default' out-of-the-box modern home page, so the one you would get with a newly created modern team site.
31
+
TakeSourcePageName | $false | The default behavior is to give the created modern page a name that starts with the prefix Migrated_ and let the original page keep it's existing name. When `-TakeSourcePageName` is specified the newly created page gets the name of the original page and the original page is renamed with a prefix Previous_. Set this option if you're sure you want to move forward with the modern page as it will ensure that all links pointing the original page now result in the new modern page being loaded.
35
32
36
33
(*) Mandatory command line parameter
37
34
38
35
## FAQ
39
36
40
-
### I choose the "AddPageAcceptBanner" option but don't see the banner web part on the created pages
37
+
### I used the "AddPageAcceptBanner" switch but don't see the banner web part on the created pages
41
38
42
39
In order to make the banner webpart work there are 2 requirements that have to be met:
0 commit comments