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.