Dim instance As ParameterAttribute
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple:=True)> _ Public NotInheritable Class ParameterAttribute Inherits ParsingBaseAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=true)] public sealed class ParameterAttribute : ParsingBaseAttribute
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Field, AllowMultiple=true)] public ref class ParameterAttribute sealed : public ParsingBaseAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=true) */ public final class ParameterAttribute extends ParsingBaseAttribute
AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=true) public final class ParameterAttribute extends ParsingBaseAttribute
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;
For more information about the syntax and parameters used to declare the Parameter attribute for functions, see about_Functions_Advanced_Parameters in the Microsoft TechNet library..
Do not declare parameters that have the following parameter names. Windows PowerShell adds these parameters to cmdlets in order to provide a consistent user experience across all cmdlets.
Debug
ErrorAction
ErrorVariable
OutBuffer
OutVariable
Verbose
WarningAction
WarningVariable
Confirm
WhatIf
UseTransaction
For more information about about parameter names, see Cmdlet Parameter Names.