I have a problem similar to THIS ONE
I go over to the function of 3 arrays and I check the type of the object this way
function _TEST { [CmdletBinding()] param ( [parameter(mandatory=$true)] [array]$Path, [parameter(mandatory=$true)] [array]$RW, [parameter(mandatory=$true)] [array]$RO ) process {
This works if I do not pass an array of functions without elements, in which case it returns this _TEST : Cannot bind argument to parameter 'Path' because it is an empty collection. error _TEST : Cannot bind argument to parameter 'Path' because it is an empty collection.
Is there a way to solve a problem like [AllowEmptyString()] in a related question, or do I need to write my own code to check the input variable?
source share