8000 Invoke-RestMethod fails on very large files · Issue #4129 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Invoke-RestMethod fails on very large files #4129

@ffeldhaus

Description

@ffeldhaus

It seems Invoke-RestMethod fails to download very large files, probably due to not enough memory.

Steps to reproduce

Invoke-RestMethod -Uri http://speedtest.tele2.net/10GB.zip -OutFile /Users/ffeldhaus/Downloads/10GB.zip

Expected behavior

Very large files should be downloaded without issues.

Actual behavior

PS /Users/ffeldhaus/development> Invoke-RestMethod -Uri http://speedtest.tele2.net/10GB.zip -OutFile /Users/ffeldhaus/Downloads/10GB.zip
Invoke-RestMethod : Stream was too long.
At line:1 char:1
+ Invoke-RestMethod -Uri http://speedtest.tele2.net/10GB.zip -OutFile / ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Invoke-RestMethod], IOException
+ FullyQualifiedErrorId :
System.IO.IOException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand     

Environment data

Mac OS X 10.12.5

PS /Users/ffeldhaus/development> $PSVersionTable                                                                                                                                                                                              

Name                           Value                                                                                                                                                                                                         
----                           -----                                                                                                                                                                                                         
PSVersion                      6.0.0-beta                                                                                                                                                                                                    
PSEdition                      Core                                                                                                                                                                                                          
BuildVersion                   3.0.0.0                                                                                                                                                                                                       
CLRVersion                                                                                                                                                                                                                                   
GitCommitId                    v6.0.0-beta.2                                                                                                                                                                                                 
OS                             Darwin 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64                                                                                                
Platform                       Unix                                                                                                                                                                                                          
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                       
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                           
SerializationVersion           1.1.0.1                                                                                                                                                                                                       
WSManStackVersion              3.0     

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0