Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$fromsite = "http://ngo.com"
$fromfile = "NGODocument/NGO.xlsx"
$tofile = "C:\NGODoc\NGODocument.xlsx"
$web = Get-SPWeb $fromsite
$file = $web.GetFile($fromfile)
$filebytes = $file.OpenBinary()
$filestream = New-Object System.IO.FileStream($tofile, "Create")
$binarywriter = New-Object System.IO.BinaryWriter($filestream)
$binarywriter.write($filebytes)
$binarywriter.Close()
$fromsite = "http://ngo.com"
$fromfile = "NGODocument/NGO.xlsx"
$tofile = "C:\NGODoc\NGODocument.xlsx"
$web = Get-SPWeb $fromsite
$file = $web.GetFile($fromfile)
$filebytes = $file.OpenBinary()
$filestream = New-Object System.IO.FileStream($tofile, "Create")
$binarywriter = New-Object System.IO.BinaryWriter($filestream)
$binarywriter.write($filebytes)
$binarywriter.Close()
No comments:
Post a Comment