The ValidateCount attribute

ValidateCount is used to test the size of an array supplied to a parameter. The attribute expects a minimum and maximum length for the array.

ValidateCount only has meaning when applied to an array-type parameter, for example:

function Test-ValidateCount {
[CmdletBinding()]
param (
[ValidateCount(1, 1)]
[String[]]$Parameter1
)
}

ValidateCount may also be applied to parameters that accept more advanced array types, such as [System.Collections.ArrayList] or [System.Collections.Generic.List[String]].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.183.150