Skip to content

Default-verb logic (implied Get- prefix) works when executing commands, but not with Get-Command and Get-Help #3987

@mklement0

Description

@mklement0

When invoking a Get-* cmdlet, the Get- prefix is optional, because Get is the default verb; E.g., Get-Content can be invoked as content.

By contrast, both Get-Command and Get-Help (as well as the common -? parameter) are unaware of this; Get-Command fails (unless there happens to be a different command with that exact name), and Get-Help / -? list all topics that contain the name.

All three scenarios should treat a given command name the same.

Steps to reproduce

'hi' > t.txt; content t.txt
'---'
Get-Command content | % Name
'---'
Get-Help content | % Name
'---'
content -? | % Name

Expected behavior

hi
---
Get-Content
---
Get-Content
---
Get-Content

Actual behavior

hi
---
Get-Command : The term 'content' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,  verify that the path is correct and try again. 
....
---
Add-Content
Clear-Content
Get-Content
Set-Content
---
Add-Content
Clear-Content
Get-Content
Set-Content

Environment data

PowerShell Core v6.0.0-beta2
Windows PowerShell v5.1.14393.1198 on Microsoft Windows 10 Pro (64-bit; v10.0.14393)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions