Windows Server® 2012 Unleashed
by Rand Morimoto, Michael Noel, Guy Yardeni, Omar Droubi, Andrew Abbate, Chris Amaris
Aliases
Like most existing command-line shells, command aliases can be defined in PowerShell. Aliasing is a method that is used to execute existing shell commands (cmdlets) using a different name. In many cases, the main reason aliases are used is to establish abbreviated command names in an effort to reduce typing. For example:
PS C:\> gps | ? {$_.Company -match ".*Microsoft*"} | ft Name, ID, Path –Autosize
The preceding example shows the default aliases for the Get-Process, Where-Object, and Format-Table cmdlets.
Alias Cmdlets
In PowerShell, several alias cmdlets enable an administrator to define new aliases, export aliases, import aliases, and display existing aliases. By using the following command, an administrator can get a list of all ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access