Secret Parameter Alias Names

It is important to note that cmdlet parameters can have assigned alias names. They are not always easy to find but they are there. This is why you can say -ea instead of -errorAction. Use this code to locate the alias parameter names of any cmdlet:

'Get-Childitem' |
Foreach-Object {
(get-command $_).parameters |
% { $_.Values |
Where-Object { $_.Aliases.Count -gt 0 } |
Select-Object Name, Aliases
}
}

You can accomplish this by simply replacing the name of the cmdlet you want to examine at the start of the pipeline.

Twitter This Tip! ReTweet this Tip!


Posted Jan 20 2010, 08:00 AM by ps1

Comments

Twitter Trackbacks for Secret Parameter Alias Names - Power Tips - PowerShell.com [powershell.com] on Topsy.com wrote Twitter Trackbacks for Secret Parameter Alias Names - Power Tips - PowerShell.com [powershell.com] on Topsy.com
on 01-21-2010 8:47 AM

Pingback from  Twitter Trackbacks for                 Secret Parameter Alias Names - Power Tips - PowerShell.com         [powershell.com]        on Topsy.com

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.