Title: Invoke-WebRequest do not generate error at break of connection while downloading · Issue #16122 · PowerShell/PowerShell · GitHub
Open Graph Title: Invoke-WebRequest do not generate error at break of connection while downloading · Issue #16122 · PowerShell/PowerShell
X Title: Invoke-WebRequest do not generate error at break of connection while downloading · Issue #16122 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/16122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-WebRequest do not generate error at break of connection while downloading","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nI am expecting a problem with «Invoke-WebRequest» in «Try-Catch».\r\nI think error should generated when Internet connection is breaking, but next operator in Try-block is running.\r\nThe file on the disk remains PARTIALLY downloaded without any errors raising.\r\n\r\n### Expected behavior\r\n\r\n```console\r\nI starts the downloading and reboots the router.\r\nTry {Invoke-WebRequest -URI TheLargeFile -ErrorAction Stop; Write-Host \"Error NOT exist\"}\r\nCatch {Write-Host \"Error exist\"}\r\n\r\nError exist\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nI starts the downloading and reboots the router.\r\nTry {Invoke-WebRequest -URI TheLargeFile -ErrorAction Stop; Write-Host \"Error NOT exist\"}\r\nCatch {Write-Host \"Error exist\"}\r\n\r\nError NOT exist\r\n```\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nName Value\r\n---- -----\r\nPSVersion 7.1.4\r\nPSEdition Core\r\nGitCommitId 7.1.4\r\nOS Microsoft Windows 10.0.19043\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/7-904-001-67-28","@type":"Person","name":"7-904-001-67-28"},"datePublished":"2021-09-19T05:40:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/16122/PowerShell/issues/16122"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4ab93388-3659-7a3d-8ca3-ee80dd76a98e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2A0:A6E9E:26D6AAB:3446E9F:6A547D6B |
| html-safe-nonce | 06b7f1f7114dca37d7a016a280bbe14cacffc6da0f16b74ae17c27ce4c6574dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkEwOkE2RTlFOjI2RDZBQUI6MzQ0NkU5Rjo2QTU0N0Q2QiIsInZpc2l0b3JfaWQiOiI1NDcyMzIyNzQ2NzgzNjYxNDE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4d3ff8cb2fbbf2cde7daea5c7e3178fbc52e19382e292cfe35699c1b4bc06e50 |
| hovercard-subject-tag | issue:1000216159 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/16122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23958924a69c05955c7792868a7db3d0ae3800820b426169bfb68da31467f26a/PowerShell/PowerShell/issues/16122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23958924a69c05955c7792868a7db3d0ae3800820b426169bfb68da31467f26a/PowerShell/PowerShell/issues/16122 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 7-904-001-67-28 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width