-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Description
Summary of the new feature / enhancement
With PowerShell, you sometimes get objects which have properties that are actually an array of objects. The Threads and Modules Properties on System.Diagnostics.Process object. When Format-List/Format-Table formats these parameters, they only include up to a certain number of occurrences, by default 4. The number of enumerations shown is determined by the automatic variable $FormatEnumerationLimit. So if you want more, you just update that variable, typically in a $Profile.
Here is the current behaviour:
PS> $FormatEnumerationLimit
4
PS> Get-Process | Select-Object -Property Name, Threads -First 4
Name Threads
---- -------
AggregatorHost {5240}
ApplicationFrameHost {16968, 2848, 18728}
AppVShNotify {9164}
Atom.SDK.WindowsService {4064, 4908, 4912, 19144…}
PS> $FormatEnumerationLimit = 1
PS> Get-Process | Select-Object -Property Name, Threads -First 4
Name Threads
---- -------
AggregatorHost {5240}
ApplicationFrameHost {16968…}
AppVShNotify {9164}
Atom.SDK.WindowsService {4064…}I propose adding a new parameter to both Format-List and Format-Table, -FormatEnumerationLimit which overrdes the value of $FormatEnumerationLimit, but just for this command. Like this:
PS> Get-Process | Select-Object -First 4 | Format-Table Name, Threads -FormatEnumerationLimit 2
Name Threads
---- -------
AggregatorHost {5240}
ApplicationFrameHost {16968, 2848…}
AppVShNotify {9164}
Atom.SDK.WindowsService {4064, 4908…}Proposed technical implementation details (optional)
- Update each cmdlet with the extra parameter
- Change the logic for handling enumeration limit by using the parameter value if it is specified.
- Retain the default value and default variable handling.
ClintRajaniemi, bb010g, mattcargile and o-l-a-vkrzydoug
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 bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module