Get-Command: resolve noun-only names with the default verb#27672
Open
TheD0ubleC wants to merge 1 commit into
Open
Get-Command: resolve noun-only names with the default verb#27672TheD0ubleC wants to merge 1 commit into
TheD0ubleC wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
TheD0ubleC
marked this pull request as ready for review
July 10, 2026 11:38
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
kilasuit
approved these changes
Jul 10, 2026
kilasuit
left a comment
Collaborator
There was a problem hiding this comment.
I've pulled down, built and tested this PR from a visual UI perspective and approve this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Make
Get-Commandretry a literal noun-only name with the defaultGet-verb when the exact lookup fails, matching normal command invocation.Exact command names still take precedence. Wildcard, fuzzy, abbreviated, path, and module-qualified lookups keep their existing behavior, and the retry uses the same command type and module filters as the original lookup.
PR Context
Command discovery already prepends
Get-when a noun-only command cannot be found.Get-Commandperforms its own enumeration and did not apply that fallback, so invokinglocationworked whileGet-Command locationreturnedCommandNotFoundException.Fixes #17438
Testing
Start-PSBuild -UseNuGetOrg -SkipRoslynAnalyzersStart-PSPester -Path test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 -UseNuGetOrgPR Checklist