PowerShell / PowerShell/PowerShell

Consider easier to read file lengths in directory listings.

Open
#24,011 14 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Enhancement KeepOpen Up-for-Grabs WG-Cmdlets WG-Reviewed
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Summary of the new feature / enhancement

There have over the years been multiple suggestions for "I think a directory listing should look different" , so I will apologise for adding one. I'm also aware that one can personalize the formatting XML and I have helped other people to do that.
OK.
I bought a new external hardisk and did a backup of my laptop (machine name Elasmo) Here's what I see

    Directory: D:\WindowsImageBackup\ELASMO\Backup 2024-07-03 205724

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          04/07/2024    01:36      859832320 0a72971c-7f53-43a3-b802-a18b0fcb0b5f.vhdx
-a---          04/07/2024    01:35            776 71a539b2-457c-49bf-b00a-30c9b87935e1_AdditionalFilesc3b9f3c7-5e52-4d5e-8b20-19adc95a34c7.xml
-a---          04/07/2024    01:35          17088 71a539b2-457c-49bf-b00a-30c9b87935e1_Components.xml
-a---          04/07/2024    01:35           6884 71a539b2-457c-49bf-b00a-30c9b87935e1_RegistryExcludes.xml
-a---          04/07/2024    01:35          10726 71a539b2-457c-49bf-b00a-30c9b87935e1_Writer4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f.xml
-a---          04/07/2024    01:35           1488 71a539b2-457c-49bf-b00a-30c9b87935e1_Writer542da469-d3e1-473c-9f4f-7847f01fc64f.xml
-a---          04/07/2024    01:35           1484 71a539b2-457c-49bf-b00a-30c9b87935e1_Writera6ad56c2-b509-4e6c-bb19-49d8f43532f0.xml
-a---          04/07/2024    01:35           2940 71a539b2-457c-49bf-b00a-30c9b87935e1_Writerafbab4a2-367d-4d15-a586-71dbb18f8485.xml
-a---          04/07/2024    01:35           6722 71a539b2-457c-49bf-b00a-30c9b87935e1_Writerbe000cbe-11fe-4426-9c58-531aa6355fc4.xml
-a---          04/07/2024    01:35           5402 71a539b2-457c-49bf-b00a-30c9b87935e1_Writercd3f2362-8bef-46c7-9181-d62844cdc0b2.xml
-a---          04/07/2024    01:35        7345084 71a539b2-457c-49bf-b00a-30c9b87935e1_Writere8132975-6f93-4464-a53e-1050253ae220.xml
-a---          04/07/2024    01:36  1298450612224 a33d2db2-06cd-47f6-887a-7853ac70e49f.vhdx
-a---          04/07/2024    01:35           1528 BackupSpecs.xml
-a---          04/07/2024    01:36       62914560 Esp.vhdx

How big are the 3 VHDX files ?

Once a number gets beyond half a dozen digits it is really hard to judge the size at a glance. In this case 1298450612224 needs me to count the digits to see it is 1,298,450,612,224 .

The default formatting could include commas, or could change the numbers to read either 1298 GB or 1.3TB (similar to file explorer in Windows) .

Proposed technical implementation details (optional)

Change the formatting XML to either
use "N0" (number separators, no decimals) as the format for the length column
OR
Use a script block to convert numbers above some size to TB, GB etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the default directory-listing formatting XML and inspect how the Length column is rendered. Compare the proposed N0 number separators with the alternative script-block conversion for large values. Done means directory listings show file sizes that are easier to read while preserving usable column alignment.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.