A parameter alias is an alternate name accepted by a command for one of its parameters. It lets a familiar or shorter name select the same parameter without changing the command’s behavior. section 4.6.2
For example, Get-Process has an -ErrorAction parameter whose alias is -ea. Both names select the same common parameter, although the standard help display does not show -ea. section 4.6.2
Discover and use a parameter alias with these practical steps:
- Inspect the command’s parameter metadata to find aliases: (Get-Command Get-Process | Select-Object -Expand Parameters).ErrorAction.Aliases. section 4.6.2
- Use the discovered alias in a command, such as Get-Process -ea Stop. section 4.6.2
- Remember that tab completion can reveal an alias even when command help does not explain its relationship to the full parameter name. section 4.6.2
When defining a script parameter, add an Alias attribute. A disk-inventory script can accept -host as an alternative name for -ComputerName while retaining the conventional full parameter name. section 20.4
Adding a script parameter alias
Declare the parameter as [Alias('host')][string]$computername, then run the script with .\Get-DiskInventory -host SRV02. The alias belongs to -ComputerName, not to another parameter such as -drivetype. section 20.4 section 20.7
Inspect a command’s parameter metadata to locate the aliases attached to a specific parameter. section 4.6.2
Choose aliases that clarify a script without creating ambiguity. The example avoids -hostname because that name indicates an SSH connection in PowerShell remoting, and parameter aliases can be difficult for other users to discover. section 20.4 section 4.6.2





