Dim instance As ParameterAttribute Dim value As Boolean value = instance.Mandatory instance.Mandatory = value
Public Property Mandatory As Boolean
public bool Mandatory { get; set; }
public: property bool Mandatory { bool get (); void set (bool value); }
/** @property */ public boolean get_Mandatory () /** @property */ public void set_Mandatory (boolean value)
public function get Mandatory () : boolean public function set Mandatory (value : boolean)
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;
This property is an optional Named parameter of the Parameter attribute. For more information about the declaration syntax that is used to specify the Parameter attribute for cmdlets, see ParameterAttribute Declaration.