# encoding: ascii
# api: powershell
# title: Get-Parameter
# description: Give as input a cmdlet name. Output is a set of properties about each parameter, including: name, parameter set, aliases, ismandatory, and CommonParameter. Thanks to LucD for the technique.
# version: 0.1
# type: function
# author: halr9000
# license: CC0
# function: Get-Parameter
# x-poshcode-id: 255
# x-archived: 2009-11-14T08:22:37
#
#
function Get-Parameter ($Cmdlet) {
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
$Output = @()
foreach ($param in $paramset.Parameters) {
$process = "" | Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter
$process.Name = $param.Name
if ( $paramset.name -eq "__AllParameterSets" ) { $process.ParameterSet = "Default" }
else { $process.ParameterSet = $paramset.Name }
$process.Aliases = $param.aliases
$process.IsMandatory = $param.IsMandatory
if ($param.aliases -match "vb|db|ea|wa|ev|wv|ov|ob") { $process.CommonParameter = $TRUE }
else { $process.CommonParameter = $FALSE }
$output += $process
}
Write-Output $Output
#Write-Host "`n"
}
}