O'Reilly logo

Windows PowerShell™ 3.0 Step by Step by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The parameter attribute

The parameter attribute accepts a number of properties that add power and flexibility to your advanced Windows PowerShell function. The parameter attribute properties are shown in Table 7-1.

Table 7-1. Advanced function parameter attribute properties and meanings

Parameter attribute property

Example

Meaning

Mandatory

Mandatory=$true

The parameter must be specified.

Position

Position=0

The parameter occupies the first position when calling the function.

ParameterSetName

ParameterSetName=“name”

The parameter belongs to the specified parameter set.

ValueFromPipeline

ValueFromPipeline=$true

The parameter accepts pipelined input.

ValueFromPipelineByPropertyName

ValueFromPipelineByPropertyName=$true

The parameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required