$result = Get-ADUser -Filter $filter
If I have 2 or more results, I get $x as array, but if I have only one result, a get $x as object. How to make it more correct, to always recieve array - empty, with one element or with some elements?
Try $x = @(get-aduser)
The @() syntax forces the result to be an array
1.4m articles
1.4m replys
5 comments
57.0k users