Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-WebRequest do not generate error at break of connection while downloading #16122

Closed
5 tasks done
7-904-001-67-28 opened this issue Sep 19, 2021 · 2 comments · Fixed by #19558
Closed
5 tasks done
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Fixed The issue is fixed. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module

Comments

@7-904-001-67-28
Copy link

7-904-001-67-28 commented Sep 19, 2021

Prerequisites

Steps to reproduce

I am expecting a problem with «Invoke-WebRequest» in «Try-Catch».
I think error should generated when Internet connection is breaking, but next operator in Try-block is running.
The file on the disk remains PARTIALLY downloaded without any errors raising.

Expected behavior

I starts the downloading and reboots the router.
Try {Invoke-WebRequest -URI TheLargeFile -ErrorAction Stop; Write-Host "Error NOT exist"}
Catch {Write-Host "Error exist"}

Error exist

Actual behavior

I starts the downloading and reboots the router.
Try {Invoke-WebRequest -URI TheLargeFile -ErrorAction Stop; Write-Host "Error NOT exist"}
Catch {Write-Host "Error exist"}

Error NOT exist

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@CarloToso
Copy link
Contributor

Related #12249

@ghost ghost added In-PR Indicates that a PR is out for the issue and removed In-PR Indicates that a PR is out for the issue labels Apr 23, 2023
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue Needs-Triage The issue is new and needs to be triaged by a work group. labels Jun 19, 2023
@ghost
Copy link

ghost commented Jun 29, 2023

🎉This issue was addressed in #19558, which has now been successfully released as v7.4.0-preview.4.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Fixed The issue is fixed. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module
Projects
None yet
3 participants