February 2019
Intermediate to advanced
626 pages
15h 51m
English
ValidateLength can be applied to a String parameter or a parameter that contains an array of strings. Each string will be tested against the minimum and maximum length:
function Test-ValidateLength { [CmdletBinding()] param ( [ValidateLength(2, 6)] [String[]]$Parameter1 )}
Any string with a length below the minimum, or above the maximum, will trigger an error.
Read now
Unlock full access