简体   繁体   中英

Unable to use Copy-PnP File to copy site pages across sharepoint online sites

I tried using all the below examples for copying my site pages across different SharePoint sites but always keep getting the below error: Can someone give correct syntax, please?

Copy-PnPFile: Cannot contact site at the specified URL

Copy-PnPFile -SourceUrl SitePages/Home.aspx -TargetUrl "/sites/destination/SitePages"
Copy-PnPFile -SourceUrl SitePages -TargetUrl "/sites/destination/SitePages"
Copy-PnPFile -SourceUrl /sites/sourcesite/SitePages/Home.aspx -TargetUrl "/sites/destination/SitePages"

Did the TargetUrl sitr is valid? "/sites/destination" should be existed in your Tenant.

I tested the PowerShell command below, it will pop up a confirm dialogue like this if the target url is correct:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM