If you need to return an int list, use the jachymko solution .
Otherwise, if you are not particularly interested in whether what you get is a list or an array, but just want to iterate the result, you can wrap the result in @ () when listing, for example.
$fooList = CreateClrList foreach ($foo in @($fooList)) { ... }
This will cause @($fooList) to have an array type โ an empty array, an array with one element or an array with several elements.
ya23 Oct 19 '12 at 7:07 2012-10-19 07:07
source share