PowerShell / PowerShell/PowerShell
Get-Command can't resolve commands entered by omitting the Get-* verb, though command discovery can
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
Description
Summary of the new feature / enhancement
As a user, I would expect Get-Command to mirror command discovery; if I can invoke a command (e.g., uptime) then I should be able to find the command pwsh is invoking with Get-Command.
However, Get-Command uptime returns no results, despite simply calling uptime ending up finding and calling Get-Uptime.
Proposed technical implementation details (optional)
Get-Command should implement the same fallback behaviour used in command discovery; if no results are found and the command contains no verb, the Get- verb should be prepended to try to find the command in the same way command discovery normally would find the command.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Get-Command and the command-discovery path, comparing how each handles a name without a verb such as uptime. Done means Get-Command uptime resolves the same Get-Uptime command that invoking uptime resolves, while existing verb-qualified lookups continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100