Skip to content

Get-Command can't resolve commands entered by omitting the Get-* verb, though command discovery can #17438

Description

@vexx32

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeWG-Cmdletsgeneral cmdlet issuesWG-ReviewedA Working Group has reviewed this and made a recommendation

    Type

    No type

    Projects

    Status
    Reviewed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions