-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Measure-Object should support TimeSpan #10712
Copy link
Copy link
Closed
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-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-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Metadata
Metadata
Assignees
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-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-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Summary of the new feature/enhancement
TimeSpans have all arithmetic operators defined on them (addition, subtraction, division, multiplication, equality, greater/less than). However,
Measure-Objectonly works on numbers. If you pipe aTimeSpanto it, it will error withIt would be very useful if
Measure-Objectcould work onTimeSpanobjects too.Example use case: Measure the time spent in meetings today and their average duration:
Currently, this is more cumbersome:
And this only gets you the sum. All the other stats require way more code.