Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Download Files in a SharePoint Document Library
WhatsApp
Lakshmanan Sethu Sankaranarayan
11y
7.9
k
0
0
25
Blog
Let's say you want to download all the files in a SharePoint document library 2013, do run the following Power Shell commands and it works like a charm.
$Site = Get-SPSite “http://mysite/sites”
$files =$
Site
.RootWeb.GetFolder("My Documents").Files
foreach ($file in $files) {
$b = $file.OpenBinary()
$fs = New-Object System.IO.FileStream(("D:\Docs\"+$file.Name), [System.IO.FileMode]::Create)
$bw = New-Object System.IO.BinaryWriter($fs)
$bw.Write($b)
$bw.Close()
}
The files are stored in D Drive of your local machine.
Download Files in a SharePoint Document Library
People also reading
Membership not found