Secret Parameter Alias Names

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

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

Copyright 2012 PowerShell.com. All rights reserved.