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