Feature Request / Get-Command <a cmdlet alias> should return the full info.
See original GitHub issueSummary of the new feature/enhancement
Get-Command <a cmdlet alias>
should return the same info as to Get-Command <cmdlet full name>
.
But currently, Get-Command <a cmdlet alias>
only returns the cmdlet full name.
Demo on Invoke-WebRequest and its alias iwr
# Get-Command without any params
6.2.2> gcm iwr
CommandType Name Version Source
----------- ---- ------- ------
Alias iwr -> Invoke-WebRequest
6.2.2> gcm Invoke-WebRequest
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Invoke-WebRequest 6.1.0.0 Microsoft.PowerShell.Utility
# Get-Command with the param -Syntax
6.2.2> gcm iwr -Syntax
Invoke-WebRequest
6.2.2> gcm Invoke-WebRequest -Syntax
Invoke-WebRequest [-Uri] <uri> [-UseBasicParsing] [-WebSession <WebRequestSession>] [-SessionVariable <string>] [-AllowUnencryptedAuthentication] [-Authentication <WebAuthenticationType>] [-Credential <pscredential>] [-UseDefaultCredentials] [-CertificateThumbprint <string>] [-Certificate <X509Certificate>] [-SkipCertificateCheck] [-SslProtocol <WebSslProtocol>] [-Token <securestring>] [-UserAgent <string>] [-DisableKeepAlive] [-TimeoutSec <int>] [-Headers <IDictionary>] [-MaximumRedirection <int>] [-MaximumRetryCount <int>] [-RetryIntervalSec <int>] [-Method <WebRequestMethod>] [-Proxy <uri>] [-ProxyCredential <pscredential>] [-ProxyUseDefaultCredentials] [-Body <Object>] [-Form <IDictionary>] [-ContentType <string>] [-TransferEncoding <string>] [-InFile <string>] [-OutFile <string>] [-PassThru] [-Resume] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] [<CommonParameters>]
Proposed technical implementation details (optional)
We expect to see exactly the same info between Get-Command iwr
and Get-Command Invoke-WebRequest
. And the same for all the params.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
'Get-Command ?' returns % (ForEach-Object alias) and ...
This issue is relevant to the new PSSA bug PowerShell/PSScriptAnalyzer#1209 and relates to probably any version of PowerShell Steps to ...
Read more >Get-Help (Microsoft.PowerShell.Core)
The Get-Help cmdlet displays information about PowerShell concepts and ... If you specify the exact name of a command alias, Get-Help displays the...
Read more >How to make a function be an alias to a cmdlet
I want to do it without using Set-Alias/New-Alias because I do not want the Aliases to show up when we do Get-Command from...
Read more >Windows PowerShell Cheat Sheet
Get -Alias sends ca 160 objects (aliases) through the pipeline. All objects have the property name , which is matched against a regexp....
Read more >An A-Z Index of Windows PowerShell commands
An A-Z Index of Windows PowerShell commands. Get-Acl, Set-Acl, Get-Alias, Get-ChildItem, Get-Command, Add-Content, Get-Content, Set-Content, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
One important use of
Get-Command
is to find out what kind of command you have. Hiding the fact that your command is an alias by default is highly undesirable. However, I think it’s reasonable forGet-Command -Syntax
to “follow the link” and give you the syntax of the aliased command. If this is done, I don’t see a particular need for a-Resolve
parameter.Good points, @copdips and @kilasuit - adding a
-Resolve
switch has been proposed before, in #7387