I have a problem similar to THIS ONE
I'm passing to a function 3 arrays and I validate object type this way
function _TEST {
[CmdletBinding()]
param (
[parameter(mandatory=$true)]
[array]$Path,
[parameter(mandatory=$true)]
[array]$RW,
[parameter(mandatory=$true)]
[array]$RO
)
process {
# my code
}
It works unless I pass to function array without elements, in that case it returns this error _TEST : Cannot bind argument to parameter 'Path' because it is an empty collection.
Is there a way to solve the problem similar to [AllowEmptyString()] in linked question or do I have to write custom code to test input variable?