Forum Discussion

María José Pedreira's avatar
María José Pedreira
Copper Contributor
Apr 24, 2017
Solved

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,...
  • Pieter Veenstra's avatar
    Apr 24, 2017

    Hi María José Pedreira,

     

    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.

Resources