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)
When invoking a
Get-*cmdlet, theGet-prefix is optional, becauseGetis the default verb; E.g.,Get-Contentcan be invoked ascontent.By contrast, both
Get-CommandandGet-Help(as well as the common-?parameter) are unaware of this;Get-Commandfails (unless there happens to be a different command with that exact name), andGet-Help/-?list all topics that contain the name.All three scenarios should treat a given command name the same.
Steps to reproduce
Expected behavior
Actual behavior
Environment data