Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Invoke-WebRequest allow option to preserve orginal filename (even after redirect) #9742

Copy link
Copy link
@JohnRusk

Description

@JohnRusk
Issue body actions

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-linux

It 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.

This is useful for cases where the filename conveys useful information (such as the version).

But 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

Proposed technical implementation details (optional)

Add a new command line parameter, called something like `PreserveFilename'. So the PowerShell equivalent of the Linux command above would be

Invoke-WebRequest https://aka.ms/downloadazcopy-v10-linux --PreserveFilename
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-AnsweredThe question is answered.The question is answered.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.