Forum Discussion
Bernd Verhofstadt
Aug 31, 2016Iron Contributor
Download folder or library from sharepoint online using powershell
Hi, I'm looking for a way to download a folder or library from SharePoint Online by using Powershell. At the moment I'm able to upload or download a file + upload a folder to SPO by using PnP. ...
- Sep 02, 2016There are a few ways to go about this, but the easiest is to use WebDav for the path and then basic file commands such as Get-ChildItem, will just work. The general format is: \\yoursite.sharepoint.com@SSL\DavWWWRoot\ServerRelativePath
DougWare
Sep 02, 2016Brass Contributor
There are a few ways to go about this, but the easiest is to use WebDav for the path and then basic file commands such as Get-ChildItem, will just work. The general format is: \\yoursite.sharepoint.com@SSL\DavWWWRoot\ServerRelativePath
- Bernd VerhofstadtSep 02, 2016Iron Contributor
Thanks for providing this idea, I was able to download a folder in only few lines!
$webDavUrl = "\\yoursite.sharepoint.com@SSL\DavWWWRoot\ServerRelativePath" Get-ChildItem -Path $webDavUrl -Recurse | % { $dest = Join-Path -Path "\\domain\folder" -ChildPath (Split-Path $_.FullName -NoQualifier).Replace($webDavUrl, ''); Copy-Item $_.FullName -Destination $dest -Force }