Mar 27 2017 02:44 AM
Hi
Has anyone seen any PnP-PowerShell to upload a) a file in Windows filestore into an existing document set or b) upload multiple files in Windows filestore into an existing document set ?
I can file PnP-Powershell to create Document Sets, Delete Document sets etc, but not add files to an existing document set.
@VesaJuvenon @ErwinVanHunen
Thanks
Nigel
Mar 27 2017 07:04 AM
Hi @Nigel Price,
Have you tried adding the fiels in the same way as you would do with a folder?
So with Add-PnPFile something like this:
PS:> Add-PnPFile -Path .\sample.doc -Folder "Shared Documents/DocumentSetName"
Mar 27 2017 07:08 AM
Try in the below format, specify the document set as <Library Name>/<Document Set Name>
Add-PnPFile -Folder "Shared Documents/docsetfolder1" -Path "C:\test1.xml"
Mar 28 2017 07:52 AM
Thanks @NarasimaPerumal Chandramohan @Pieter Veenstra for the responses. Works good.
May 25 2017 12:42 PM
NarasimaPerumal,
I have tried your suggestion, with my substitutions:
Add-PnPFile -Folder "Shared Documents/documents" -Path "C:\temp\NormalFileName.txt"
and get the error: Add-PnPFile : Local file was not found.
Yet I can see the file in Windows Explorer.
I am trying to get a Powershell script working to load files in a hard drive/file share to SharePoint Online.
Jul 19 2018 09:21 AM
First of all, make sure that you connected to the correct site.
Secondly, try this code. Path is a positional parameter:
Add-PnPFile -Path "C:\temp\NormalFileName.txt" -Folder "Shared Documents/documents"