-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Summary of the new feature / enhancement
Introduce a native -AlphabeticOrder switch to Select-Object and common Get-* cmdlets to alphabetically sort property output, improving readability and usability—especially in large data sets.
Summary
Introduce a native -AlphabeticOrder switch to Select-Object and common Get-* cmdlets to alphabetically sort property output, improving readability and usability—especially in large data sets.
Why It's Needed
Currently, viewing PowerShell object properties in consistent, predictable alphabetical order requires verbose syntax with nested Get-Member, Sort-Object, and dynamic selection. This impairs readability and adds unnecessary complexity.
The typical workaround:
$props = (Get-Mailbox -ResultSize 1 | Get-Member -MemberType NoteProperty | Sort-Object Name).Name
Get-Mailbox -ResultSize Unlimited | Select-Object $props
This is far more convoluted than it needs to be for what amounts to a display preference.
Proposed Syntax
Get-Mailbox -ResultSize Unlimited | Select-Object -AlphabeticOrder
or as part of native output shaping:
Get-Process -AlphabeticOrder
Real-World Impact
In commands like Get-Mailbox, which return dozens of properties, searching for key fields like ExternalDirectoryObjectId, Guid, or ArchiveGuid becomes frustrating due to the unsorted output. Admins often rely on visual scanning or pipe everything to GridView or CSV just to locate a single attribute.
Alphabetical output:
- Enables fast, predictable scanning—especially in large objects
- Eases debugging and report creation
- Promotes consistency in documentation and script output
- Reduces cognitive overhead in complex auditing or forensics scenarios
Closing Thought
This request is not about reengineering PowerShell’s core—just adding an ergonomic switch to elevate output clarity. Alphabetical display of properties should be an option as intuitive and accessible as Select-Object -Property *.