-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Consider easier to read file lengths in directory listings. #24011
Copy link
Copy link
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
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
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.
@PowerShell/wg-powershell-cmdlets reviewed this, we agreed to expose a
$PSStyle.HumanReadablesetting which is an object with properties indicating what types of formatted data would be humanized as booleans:Size,Datetime,Timespanand others can be added in the future as needed. OnlySizewould be$trueby default as we expect most users would want that particularly forGet-ChildItem. Before any implementation starts, we ask that someone make the effort to write an implementation design proposal in this issue.ps1xmlfiles would use$PSStyleto determine when to humanize.