Finding Parameter Aliases

by Jan 10, 2011

Sometimes, cmdlet parameters have additional alias names, but these names aren't well documented. Here is a script that will list all parameter alias names for all cmdlets:

$common = "Verbose,Debug,ErrorAction,WarningAction,ErrorVariable,WarningVariable,OutVariable,OutBuffer".Split(',')

Get-Command |

ForEach-Object {$cmdlet = $_$cmdlet.parameters |

ForEach-Object { $_.Values |

Where-Object {

$_.Aliases.Count -gt 0 } |

Where-Object { $common -notcontains $_.Name } |

Select-Object Cmdlet, Name, Aliases

} |

ForEach-Object {

$_.Cmdlet = $cmdlet.name$_

}

}

Twitter This Tip!
ReTweet this Tip!