Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ParameterAttribute Constructor

Constructs a ParameterAttribute object. For more information about the declaration syntax that is used to specify the Parameter attribute for cmdlets, see ParameterAttribute Declaration.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim instance As New ParameterAttribute

public ParameterAttribute ()
public ParameterAttribute ()
public function ParameterAttribute ()

This example shows how the Parameter attribute is used to declare a mandatory parameter.

[Parameter(Position = 0, Mandatory = true)]
public string UserName
  get { return userName; }
  set { userName = value; }
private string userName;

The default constructor initializes any fields to their default values.


Target Platforms

© 2015 Microsoft