It is quite common, there is a file in SharePoint, and you want to see it written to a local disk. How to do that in PowerShell? Here’s how:
$site = New-Object Microsoft.SharePoint.SPSite($SharePoint Location) $web = $site.OpenWeb() $item = $web.GetListItem($SharePoint Location) $fileStream = ( $item.file.OpenBinary()) $stream = New-Object System.IO.FileStream($LocalDiskFileLocation ,[System.IO.FileMode]::Create) $writer = New-Object System.IO.BinaryWriter($stream) $writer.write($fileStream) $writer.Close() |
Additonal Read
SharePoint Document IDs
Want to talk?
Drop us a line. We are here to answer your questions 24*7.