SharePoint 2013 PowerShell: How to download a large file from SharePoint using PowerShell

Today I got a question from MSDN Forums: A large OneNote file is stored in SharePoint Site and isn't downloaded or viewed, it shows the "Not Responding" message.

 

Maybe the file is so large that it needs to take a long time to open, so there is "Not Responding" message shown when opening it.

 

I provide a solution for it under my test.

 

Solution: Download the file to location and review it using PowerShell Script.

 

Please refer to the demo script below:

 

  1. Variables for Site URL\Path\Username and Password, Open SharePoint PowerShell and run it as the Administration, type the following cmdlet:
$Url = "http://cpshelley:9001/sites/Project_Shelley/Shared%20Documents/New%20Section%201.one"
$Path = "C:\test\New Section 1.one"
$Username = "cp01\administrator"
$Password = "1qaz2wsxE"

 

 2. Type the following cmdlet to execute the "Download" action:

 

$WebClient = New-Object System.Net.WebClient
$WebClient.Credentials = New-Object System.Net.Networkcredential($Username, $Password)
$WebClient.DownloadFile( $url, $path )

 

 

Hopefully it is useful for you!

Best Regards