Export (0) Print
Expand All

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)

'Usage
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

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft