Forum Discussion
Nigel_Price9911
Mar 27, 2017Iron Contributor
PnP-Powershell to upload files into Document Sets
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 ca...
John Heck
May 25, 2017Copper Contributor
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.
Markus Hanisch
Jul 19, 2018Brass Contributor
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"