Skip to content

Feature Request: Add -AlphabeticOrder switch for Select-Object and common Get-* cmdlets #25719

@rayc567

Description

@rayc567

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 *.

Proposed technical implementation details (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtimeWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions