Forum Discussion
María José Pedreira
Apr 24, 2017Copper Contributor
Upload Pages using Powershell / PnP
I need to upload the same Page into the Pages library in several webs. In my example, I'm located in my root path (http://myhost/Pages) and the first 3 lines work ok. I get an error in my line 4,...
- Apr 24, 2017
What is the error that you get?
Have you tried using a web object rather than a web url?
Add-PnPFile -Path $filePath -Web $Web -Folder $folder
Also have you tried with the / in the web url?
In general I use Get-PnPWeb and Get-PnPSubWebs to get my web object before calling Add-@PnPFile and that seems to work.
Deleted
Apr 24, 2017I think it it your firstweb... maybe you fill in the whole path.