Invoke-webrequest unable to download large files - stream too long
See original GitHub issueHi,
This is half a feature request/bug.
When downloading very large files (> 1GB), Invoke-Webrequest
will:
- usually crash with a stream too long exception,
- consume huge amount of memory, going beyound 2.5GB or RAM used.
Which make this commandlet unsuited for something that would work flawlessly on wget
.
Do you have any plans on improving this? How complex would this feature be?
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Powershell - Why is Using Invoke-WebRequest Much ...
The reason this improves performance here is because Invoke-WebRequest (and Invoke-RestMethod ) count the downloaded bytes too often (every ...
Read more >windows server 2012 r2 - Download big files with PowerShell
Invoke -WebRequest was designed for small files and it's speed is very slow. Note that BITS can show progress, because Write-Progress cmdlet can ......
Read more >Invoke-webrequest downloads a few kb and stops
In order to download a file, Invoke-WebRequest isn't the most optimal way as the HTTP response stream is buffered into memory, and once...
Read more >Invoke-WebRequest timer, need advice :] : r/PowerShell
My problem is when I use invoke-restmethod it fails the download because there's not enough ram on the computer to store it, then...
Read more >PowerShell wget : Awesome Way to Download a File
Learn how to leverage PowerShell like a PowerShell wget to download a file URL in this step-by-step demo tutorial.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is still a problem in 2023. PowerShell is a ridiculous joke at this point.
You need to specify
-OutFile
to store the data into a file and bypass this problem. The default behaviour is to store the response in memory and that has limits as you’ve encountered.