[release/v7.6] Properly Expand Aliases to their actual ResolvedCommand by adityapatwardhan · Pull Request #26571 · PowerShell/PowerShell
Backport of #25763 to release/v7.6
Triggered by @adityapatwardhan on behalf of @kilasuit
Original CL Label: CL-Engine
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
- Required tooling change
- Optional tooling change (include reasoning)
Customer Impact
- Customer reported
- Found internally
This fixes a long-standing quirk in how aliased commands display their resolved command names. The change improves user experience by consistently showing alias -> resolved command mapping for better discoverability. This is an engine improvement that affects how Get-Alias displays command information.
Regression
REQUIRED: Check exactly one box.
- Yes
- No
This is not a regression.
Testing
Original PR added comprehensive tests in Get-Alias.Tests.ps1 to verify that DisplayName always shows the correct "AliasName -> ResolvedCommand" format for all aliases. The fix was verified to resolve issue #25616.
Risk
REQUIRED: Check exactly one box.
- High
- Medium
- Low
This is a display/formatting improvement in the engine's alias system with comprehensive test coverage. The change is isolated to the DisplayName script property logic and doesn't affect core command execution or critical functionality.