February 2019
Intermediate to advanced
626 pages
15h 51m
English
ValidateNotNullOrEmpty extends ValidateNotNull to disallow empty arrays and empty strings:
function Test-ValidateNotNullOrEmpty { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [String]$Parameter1, [ValidateNotNullOrEmpty()] [Object[]]$Parameter2 )}
An error will be thrown if either an empty string is supplied for Parameter1, or an empty array is supplied for Parameter2. Like ValidateNotNull, ValidateNotNullOrEmpty has no effect on numeric types.
Read now
Unlock full access