ValidateArgumentsAttribute
Validators that inherit from ValidateArgumentsAttribute are somewhat difficult to define. The existing validators, such as ValidateNotNullOrEmpty and ValidateCount, catch most of the possible uses. Validation is more often interested in testing whether the value of parameter is an array.
Classes that inherit from ValidateArgumentsAttribute act on an argument as a single entity. If an argument is an array, the validation step applies to the array object rather than the individual elements of the array.
Classes that implement ValidateArgumentsAttribute must inherit from System.Management.Automation.ValidateArgumentsAttribute. The class must implement a Validate method that is marked as abstract in the ValidateArgumentsAttribute ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access