ParameterAttribute Class

Definition

Identifies parameters to Cmdlets

[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=true)]
public sealed class ParameterAttribute : System.Management.Automation.Internal.ParsingBaseAttribute
Inheritance
Attributes

Constructors

ParameterAttribute()

Initializes a new instance of the ParameterAttribute class

Fields

AllParameterSets

ParameterSetName refering to all ParameterSets

Properties

DontShow
HelpMessage

Gets and sets a short description for this parameter, suitable for presentation as a tool tip.

HelpMessageBaseName

Gets and sets the base name of the resource for a help message. When this field is speicifed, HelpMessageResourceId must also be specified.

HelpMessageResourceId

Gets and sets the Id of the resource for a help message. When this field is speicifed, HelpMessageBaseName must also be specified.

Mandatory

Gets and sets a flag specifying if this parameter is Mandatory. When it is not specified, false is assumed and the parameter is considered optional.

ParameterSetName

Gets and sets the name of the parameter set this parameter belongs to. When it is not specified ParameterAttribute.AllParameterSets is assumed.

Position

Gets and sets the parameter position. If not set, the parameter is named.

ValueFromPipeline

Gets and sets a flag that specifies that this parameter can take values from the incoming pipeline object. When it is not specified, false is assumed.

ValueFromPipelineByPropertyName

Gets and sets a flag that specifies that this parameter can take values from a property in the incoming pipeline object with the same name as the parameter. When it is not specified, false is assumed.

ValueFromRemainingArguments

Gets and sets a flag that specifies that the remaining command line parameters should be associated with this parameter in the form of an array. When it is not specified, false is assumed.