Get-Alias should be able to provide the cmdlet name for all aliases.
alias alias
alias unique
alias alias
# Output: alias -> Get-Alias
alias unique
# Output: unique -> Get-Unique
Get-Alias alias
Get-Alias: This command cannot find a matching alias because an alias with the name 'alias' does not exist.
Get-Alias unique
Get-Alias: This command cannot find a matching alias because an alias with the name 'unique' does not exist.
$PSVersionTable
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Those aren't real aliases; PowerShell automatically prepends Get- when commands don't resolve immediately:
Unlike actual aliases, this logic isn't represented by an object or an entry in a table, it's just something PowerShell does
Basically if Get-Alias returned these implicit aliases, you'd see an alias for every command beginning with Get- when you ran Get-Alias
Thank you! That is actually really cool. Although I do wish either Get-Alias or Get-Command would display some information about what was happening.
Most helpful comment
I've opened https://github.com/MicrosoftDocs/PowerShell-Docs/issues/6576