pnpframework
pnpframework copied to clipboard
ConvertTo-PnPPage : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
I am migrating from Classic sites to Modern sites and I am trying to change the Home Page to Modern. This is the error message - -the script is simple: $SiteURL="https://xxxx.sharepoint.com/sites/xxxx" $ClassicPageName = "home.aspx"
Connect-PnPOnline $SiteURL -Interactive
ConvertTo-PnPPage -Identity $ClassicPageName -AddPageAcceptBanner
Can you please assist?
Hello @Cheridbell2 ,
Can you try if it works with the PnP.Core Solution for this.
Example:
$SiteURLTarget="https://xxxx.sharepoint.com/sites/xxxx"
$SiteURLSource="https://xxxx.sharepoint.com/sites/xxxx"
$ClassicPageName = "home.aspx"
$targetConnection = Connect-PnPOnline $SiteURLTarget -ReturnConnection
Connect to the source site
Connect-PnPOnline $SiteURLSource
Trigger transformation
Invoke-PnPTransformation -Identity $ClassicPageName -TargetConnection $targetConnection
Url: https://pnp.github.io/pnpcore/using-the-sdk/transformation-getting-started.html