Search notes:

System.Management.Automation.ParameterAttribute (class)

System.Management.Automation.ParameterAttribute allows to specify the attributes of parameters of PowerShell cmdLets or PowerShell functions (as in param([parameter(…)] $foo)).

Attributes that can be set

The attributes of the ParameterAttribute can be displayed in PowerShell with reflection like so
foreach ($prop in ([System.Management.Automation.ParameterAttribute].DeclaredProperties | sort-object Name) ) {
   "$($prop.Name) -- $($prop.PropertyType)"
}
With this method, the following attributes are found:
Name Type Comment
DontShow bool Don't show in programming assisting tools like intellisense
EffectiveAction ExperimentAction
ExperimentAction ExperimentAction
ExperimentName string Short description (for example for a tool tip)
HelpMessage string
HelpMessageBaseName string
HelpMessageResourceId string
Mandatory bool set to true to make parameter mandatory, otherwise, parameter is optional.
ParameterSetName string Name of parameter set that parameter belongs to. Default is ParameterAttribute.AllParameterSets which is the string __AllParameterSets.
Position int If not set, the parameter is a named parameter
ToHide bool ?
ToShow bool ?
ValueFromPipeline bool See this page.
ValueFromPipelineByPropertyName bool if true: objects from the pipeline with an attribute that has the same name as the parameter provide the parameter's value
ValueFromRemainingArguments bool if true: remaining arguments create an array as value for the parameter (See this page)

See also

Function and script parameter attributes in PowerShell

Index