Title: Invoke-WebRequest allow option to preserve orginal filename (even after redirect) · Issue #9742 · PowerShell/PowerShell · GitHub
Open Graph Title: Invoke-WebRequest allow option to preserve orginal filename (even after redirect) · Issue #9742 · PowerShell/PowerShell
X Title: Invoke-WebRequest allow option to preserve orginal filename (even after redirect) · Issue #9742 · PowerShell/PowerShell
Description: Summary of the new feature/enhancement As a user downloading from an aka.ms URL, I want the filename of my downloaded file to automatically match that of the source file. E.g. on Linux, if I do wget https://aka.ms/downloadazcopy-v10-linu...
Open Graph Description: Summary of the new feature/enhancement As a user downloading from an aka.ms URL, I want the filename of my downloaded file to automatically match that of the source file. E.g. on Linux, if I do wge...
X Description: Summary of the new feature/enhancement As a user downloading from an aka.ms URL, I want the filename of my downloaded file to automatically match that of the source file. E.g. on Linux, if I do wge...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9742
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-WebRequest allow option to preserve orginal filename (even after redirect)","articleBody":"# Summary of the new feature/enhancement\r\n\r\nAs a user downloading from an aka.ms URL, I want the filename of my downloaded file to automatically match that of the source file. \r\n\r\nE.g. on Linux, if I do \r\n```\r\nwget https://aka.ms/downloadazcopy-v10-linux\r\n```\r\n\r\nIt just works. The output file is created, and it has the right name. E.g. when the aka.ms link points to a file name AzCopy_linux-amd64-10.0.9.tar.gz, that's the name I end up with on disk. When someone updates the aka ms link to point to, say AzCopy_linux-amd64-10.2.0.tar.gz, then I can run the same command as before, and this time I automatically get the updated name.\r\n\r\nThis is useful for cases where the filename conveys useful information (such as the version).\r\n\r\nBut in PowerShell, I can't automatically use the file's existing name. I have to specify a name. But because the URL is a redirect, via aka.ms, I don't actually know the name of the download file in advance. So I can't specify a meaningful name (e.g. I can't include the version number). I still get the file, but I lose any information that was in its original name\r\n\r\n# Proposed technical implementation details (optional)\r\n\r\nAdd a new command line parameter, called something like `PreserveFilename'. So the PowerShell equivalent of the Linux command above would be\r\n```\r\nInvoke-WebRequest https://aka.ms/downloadazcopy-v10-linux --PreserveFilename\r\n```","author":{"url":"https://github.com/JohnRusk","@type":"Person","name":"JohnRusk"},"datePublished":"2019-05-27T22:22:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9742/PowerShell/issues/9742"}
| 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:61aa3cac-b87e-50c8-f460-9f9349b87fd7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF88:26AF6C:1D754:28876:6A5A3E42 |
| html-safe-nonce | 3b181299f8afbc4b210e6691dd986be0a2e5a389e5b31204ae05f461d329c883 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjg4OjI2QUY2QzoxRDc1NDoyODg3Njo2QTVBM0U0MiIsInZpc2l0b3JfaWQiOiI3ODc1MDc3MTE4ODkxODAyMTc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 69d6011fe7a91fdfa8a168611e3ff0b62dfbb6e8d89eb6514351d6ca14d67882 |
| hovercard-subject-tag | issue:449002857 |
| 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/9742/issue_layout |
| twitter:image | https://opengraph.githubassets.com/189d38b8e42cc8a006f4c854a71bb924f882b3790cc91ce9009c73fee76be5c1/PowerShell/PowerShell/issues/9742 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/189d38b8e42cc8a006f4c854a71bb924f882b3790cc91ce9009c73fee76be5c1/PowerShell/PowerShell/issues/9742 |
| og:image:alt | Summary of the new feature/enhancement As a user downloading from an aka.ms URL, I want the filename of my downloaded file to automatically match that of the source file. E.g. on Linux, if I do wge... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JohnRusk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19c67ad7579d2401ff06e88a32ef45460fbb40fab3191c7f7582d5e166f326fc |
| 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 | e618485bff22dab2ef1ffb4e34e4e6626688df69 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width