Skip to content

Add HistoryInfo.Duration to default display for HistoryInfo #9518

@rkeithhill

Description

@rkeithhill

Summary of the new feature/enhancement

When I run Get-History, I get this:

  Id CommandLine
  -- -----------
   1 Add-Type -Path C:\Temp\Humanizer.Core.2.6.2\lib\netstandard2.0\Humanizer.dll
   2 $ts = [TimeSpan]::new(1,42,69)
   3 [Humanizer.TimeSpanHumanizeExtensions]::Humanize($ts, 3)
   4 start-sleep 12

I want to get this:

Id   Duration CommandLine
--   -------- -----------
 1 0.00:00:00 Add-Type -Path C:\Temp\Humanizer.Core.2.6.2\lib\netstandard2.0\Humanizer.dll
 2 0.00:00:00 $ts = [TimeSpan]::new(1,42,69)
 3 0.00:00:00 [Humanizer.TimeSpanHumanizeExtensions]::Humanize($ts, 3)
 4 0.00:00:12 start-sleep 12

It is great that we added Duration but this info is a bit buried for the average user. We could surface Duration in the default output of Get-History. It would be easy. The question is, is this a good "add"? I think so but wonder what other folks think.

Proposed technical implementation details (optional)

Update the format ps1xml file for HistoryInfo to add a table column (right aligned) for Duration using a formatting string like "d\.hh\:mm\:ss". We would need to check the implications of different culture info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions