Home > Software engineering >  Is there a way to list all aliases in windows
Is there a way to list all aliases in windows

Time:11-21

I would like to know if it is possible to have a list of all aliases in windows, like the command:

Get-Alias

but that shows all aliases that are usable, for example python3 or jupyter-notebook

Thanks!

CodePudding user response:

python3 and jupyter-notebook are not aliases, they are applications, available in the search path. Aliases are a PowerShell construct and only exist within PowerShell.

But if what you're really asking is how you can list all possible commands (which includes: cmdlets, functions, aliases, applications, external scripts), then you can use Get-Command.

By default, it will not show applications, but you can tell it explicitly to return all types of commands with a wildcard in the -Name parameter:

Get-Command -Name *

You can also specify specific type(s) you want to see:

Get-Command -Type Application
Get-Command -Type Alias
Get-Command -Type Cmdlet,Application

If you want to group them to see how many of each type:

Get-Command -Name * | Group-Object -Property CommandType
  • Related