Information
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.

ValidateCountAttribute.MinLength Property

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Gets the minimum number of allowed arguments for the cmdlet parameter.

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

public int MinLength { get; }

Property Value

Type: System.Int32

The minimum number of allowed arguments for the cmdlet parameter.

This property is a required parameter of the ValidateCount attribute. For more information about the syntax and parameters that are used when declaring this attribute, see ValidateCount Attribute Declaration.

The following code example shows how this attribute can be declared:

[ValidateCount(1, 3)]
[Parameter(Position = 0, Mandatory = true)]
public string[] UserNames
{
  get { return userNames; }
  set { userNames = value; }
}

private string[] userNames;

Return to top

Community Additions

Show: