pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
989 stars 662 forks source link

Modernisation - Replay Layout Mode #2731

Closed pkbullock closed 4 years ago

pkbullock commented 4 years ago

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/PnP-PowerShell/blob/dev/CONTRIBUTING.md

Type

Related Issues?

This is related to the modernisation project: Related to PR: https://github.com/pnp/sp-dev-modernization/pull/489 Related to Issue: https://github.com/pnp/sp-dev-modernization/issues/369

Marking for @jansenbe

What is in this Pull Request ?

New cmdlet parameters, companion binary and help

Guidance

To test:


# Transforming Page based on Exported Content
#-----------------------------------------------
$spOnlineSrc = Connect-PnPOnline https://tenant.sharepoint.com/sites/PnPSauce/en -Credentials Online -ReturnConnection
$spOnlineTgt = Connect-PnPOnline https://tenant.sharepoint.com/sites/PnPKatchup -Credentials Online -ReturnConnection

ConvertTo-PnPClientSidePage -Identity "Hot-Off-The-Press-New-Chilling-Truth-About-Sauce.aspx" -PublishingPage `
    -TargetConnection $spOnlineTgt -Connection $spOnlineSrc `
    -Overwrite `
    -DisablePageComments `
    -LogType Console `
    -PublishingTargetPageName "PSTest-Chilling-Truth-About-Sauce.aspx" `
    -ReplayLayoutCapture

# In the page, change the layout

# Same Source Page - different target name to prevent overwite
ConvertTo-PnPClientSidePage -Identity "Hot-Off-The-Press-New-Chilling-Truth-About-Sauce.aspx" -PublishingPage `
    -TargetConnection $spOnlineTgt -Connection $spOnlineSrc `
    -Overwrite `
    -DisablePageComments `
    -LogType Console `
    -PublishingTargetPageName "PSTest-Replayed-Chilling-Truth-About-Sauce.aspx" `
    -ReplayLayout

# Different Page - using the same source page layout
ConvertTo-PnPClientSidePage -Identity "The-Cherry-on-the-Cake,-Transforming-to-Modern.aspx" -PublishingPage `
    -TargetConnection $spOnlineTgt -Connection $spOnlineSrc `
    -Overwrite `
    -DisablePageComments `
    -PublishingTargetPageName "PSTest-Quality-Cherry-Cake.aspx" `
    -LogType Console `
    -ReplayLayout
pkbullock commented 4 years ago

Argh, i forgot i have this PR waiting. The modernisation changes

I have created a bunch of test files as placeholders for writing unit tests for the PnP Powershell project, what's the best approach for splitting this PR into two? From all commits after "30cb6b4"

Going to close for the moment.