Skip to content

Conversation

@kilasuit
Copy link
Collaborator

@kilasuit kilasuit commented Jul 18, 2025

PR Summary

Fix #25616

This fixes a long standing "quirk" in how aliased commands would show & fixes #25616 as suggested.

There are no changes to the Get-Alias Cmdlet itself, however does update logic used by this command via the System.Management.Automation.AliasInfo object and the DisplayName ScriptProperty.

PR Context

This improves the user experience in understanding which alias maps to the resolved command to improve discoverability.

PR Checklist

@kilasuit kilasuit added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Jul 18, 2025
@kilasuit kilasuit added WG-NeedsReview Needs a review by the labeled Working Group WG-Engine core PowerShell engine, interpreter, and runtime labels Jul 18, 2025
@kilasuit
Copy link
Collaborator Author

Thanks for the review & comments @iSazonov 👍🏻, will address them and make recommended changes shortly as they were inline with my own initial thoughts.
Interesting to see how bloated Copilot can be for a first pass in the Pester Tests though without giving it additional instruction to reduce unneccessary code.

@kilasuit
Copy link
Collaborator Author

kilasuit commented Jul 19, 2025

Only reason this is marked for the Engine WG to review is due to the code path.
I feel from the discussion in the issue as this has had input from @JamesWTruher & the comments from @iSazonov we should be fine with not needing further input from across the working group for this PR, especially as we already have lots of other work that desperately needs reviewing.

Only other thing I am thinking should we have a test/ update this test for when you have
alias -> alias -> actual command and it should show the full path from first alias to end command in the DisplayName.
Will think on this & I think will add another test in a future PR for this particular test case.

Note - Having thought further on discussions had around alias -> alias -> actual command I will add this as an additional example in the Get-Alias Docs

@kilasuit kilasuit changed the title Properly Expand Cmdlet/Function Aliases - fixes #25616 Properly Expand Aliases to their actual ResolvedCommand - fixes #25616 Jul 19, 2025
Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias -> alias -> actual command

It is not related the PR. If you see real value for this please move to new PR.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Jul 30, 2025
@kilasuit kilasuit added WG-Reviewed A Working Group has reviewed this and made a recommendation and removed WG-NeedsReview Needs a review by the labeled Working Group labels Oct 6, 2025
@kilasuit
Copy link
Collaborator Author

kilasuit commented Oct 6, 2025

The Engine WG was able to review this today & have signed off on adding this behaviour. We however would like additional code review to happen prior to merging.

@kilasuit kilasuit added WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module WG-NeedsReview Needs a review by the labeled Working Group and removed WG-Engine core PowerShell engine, interpreter, and runtime WG-Reviewed A Working Group has reviewed this and made a recommendation labels Oct 8, 2025
@SteveL-MSFT SteveL-MSFT removed the WG-NeedsReview Needs a review by the labeled Working Group label Oct 15, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Review - Needed The PR is being reviewed label Oct 15, 2025
@iSazonov
Copy link
Collaborator

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@iSazonov iSazonov changed the title Properly Expand Aliases to their actual ResolvedCommand - fixes #25616 Properly Expand Aliases to their actual ResolvedCommand Oct 15, 2025
@iSazonov iSazonov merged commit 47e38be into PowerShell:master Oct 15, 2025
45 checks passed
@microsoft-github-policy-service
Copy link
Contributor

📣 Hey @@kilasuit, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Migrated CL-Engine Indicates that a PR should be marked as an engine change in the Change Log WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aliases that are like verb-noun should also show to the command they are aliasing

4 participants