I'm trying to copy files from SharePoint libraries and their metadata over to my local drive or to another hard drive eventually. I've finally managed to get the PowerShell PnP module to connect to our SharePoint (2010). I can view the ListItems per folder using
Get-PnPListItem -List "Test"
However, I'm unable to get the Get-PnPFile to work, (file name has a space in it).
Get-PnPFile -Url "\Test\1234 5678.pdf"
Gives me this error:
Get-PnPFile : Field or property "Length" does not exist. At line:1 char:1 + Get-PnPFile -Url \Test\1234 5678.pdf... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Get-PnPFile], ServerException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Files.GetFile
I've tried this on different folders and different files and still get the same error. I'm wondering if its the relative URL path I'm providing that is the issue. If I take the original URL: http://domain:port/test/1234 5678.pdf it's able to pop up the pdf in the browser. My assumption is the relative URL would be "/test/1234 5678.pdf".
I'm sure I'm missing something, please advise.