Describes how to use alternate names for cmdlets and commands in Windows (about_aliases)

# TOPICabout_aliases

# SHORT DESCRIPTION
Describes how to use alternate names for cmdlets and commands in Windows
PowerShell.

# LONG DESCRIPTION
An alias is an alternate name or nickname for a cmdlet or for a command
element, such as a function, script, file, or executable file. You
can use the alias instead of the command name in any Windows PowerShell
commands.

ALIAS CMDLETS
Windows PowerShell includes the following cmdlets, which are designed for
working with aliases:

- Get-Alias. Gets all the aliases in the current session.
- New-Alias. Creates a new alias.
- Set-Alias. Creates or changes an alias.
- Export-Alias. Exports one or more aliases to a file.
- Import-Alias. Imports an alias file into Windows PowerShell.

SAVING ALIASES
The aliases that you create are saved only in the current session. To use
the aliases in a different session, add the alias to your Windows
PowerShell profile. Or, use the Export-Alias cmdlet to save the aliases to
a file.

GETTING ALIASES
To get all the aliases in the current session, including the built-in
aliases, the aliases in your Windows PowerShell profiles, and the aliases
that you have created in the current session, type:

get-alias

To get particular aliases, use the Name parameter of the Get-Alias cmdlet.
For example, to get aliases that begin with "p", type:

get-alias -name p*

To get the aliases for a particular item, use the Definition parameter.
For example, to get the aliases for the Get-ChildItem cmdlet type:

ALTERNATE NAMES FOR COMMANDS WITH PARAMETERS
You can assign an alias to a cmdlet, script, function, or executable file.
However, you cannot assign an alias to a command and its parameters.
For example, you can assign an alias to the Get-EventLog cmdlet, but you
cannot assign an alias to the "get-eventlog -logname system" command.

However, you can create a function that includes the command. To create a
function, type the word "function" followed by a name for the function.
Type the command, and enclose it in braces ({}).

For example, the following command creates the syslog function. This function represents the "get-eventlog -logname system" command:

function syslog {get-eventlog -logname system}

You can now type "syslog" instead of the command. And, you can create
aliases for the syslog function.

ALIAS OBJECTS
Windows PowerShell aliases are represented by objects that are instances
of the System.Management.Automation.AliasInfo class. For more information
about this type of object, see "AliasInfo Class" in the Microsoft
Developer Network (MSDN) library at
http://go.microsoft.com/fwlink/?LinkId=143644.

To view the properties and methods of the alias objects, get the
aliases. Then, pipe them to the Get-Member cmdlet. For example:

To view the values of the properties of a specific alias, such as the
"dir" alias, get the alias. Then, pipe it to the Format-List cmdlet. For
example, the following command gets the "dir" alias. Next, the command
pipes the alias to the Format-List cmdlet. Then, the command uses the
Property parameter of Format-List with a wildcard character (*) to display
all the properties of the "dir" alias. The following command performs
these tasks: