Replies: 3 comments 1 reply
-
I tested this and for me it works. I did specify the page name in my targetUrl:
I copied on the same site. When you copy to another site maybe the webpart references the library based on ID and its not the same on the target site? What version of PnP.PowerShell are you using? |
Beta Was this translation helpful? Give feedback.
-
I use PnP.Powershell version 2.12.0 |
Beta Was this translation helpful? Give feedback.
-
The template is very large and unreadable for me, so I will make the settings manually for the copied pages. |
Beta Was this translation helpful? Give feedback.
-
We have about 100 sites that should have the same document libraries. I copied the sample library with
Copy-PnPList -Identity $LibraryName -DestinationWebUrl $einr -Title $LibraryName
All columns were copied, everything was correct. Then I copied the sample documents with
Copy-PnPFile -SourceUrl $_.ServerRelativeUrl -TargetUrl $TargetLibraryServerRelativeUrl -Force -OverwriteIfAlreadyExists
All documents were copied correctly and they also had the correct column settings.
In all sites there should be a sample page where a source sample page is copied and in this sample page there are several "Highlighted Content" web parts that refer to the copied library and its columns. I copied the sample page with
Copy-PnPFile -SourceUrl "/sites/$tempquelle/sitepages/Interne-Dokumente.aspx" -TargetUrl "https://xxx.sharepoint.com$einr2/sitepages" -force -Overwrite -IgnoreVersionHistory
The page is copied, but the display in the "Highlighted Content" area is not adopted. Are such settings not made during the copying process or is there an error?``
Beta Was this translation helpful? Give feedback.
All reactions