Skip to content

Invoke-WebRequest to show expected download size and more human readable format (MB/GB instead of Bytes) #14610

@bergmeister

Description

@bergmeister

Summary of the new feature/enhancement

Currently, users of Invoke-WebRequest do not know how much they have downloaded because a big Byte number gets displayed and due to the digits not being mono-spaced, I cannot even attempt to count digits whilst the number changes every second. Also, I have no progress bar to tell me how much it needs to download.

Proposed technical implementation details (optional)

ByteSize is a small (14KB) library to better display human readable file sizes but as the problem is quite simple, it was decided to not introduce a dependency but rather just hand-code it instead. Because PowerShell treats 1 KB as 1024, it should probably use 1024 as the base for KB, MB, etc.

I suggest to have one significant digit after after the comma starting with KB and increase the number of significant digits by 1 for MB, GB, etc.

PR here: #14611

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-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