Powershell will always return array and $array.count wil always be a number.
Powershell Gotcha:If you want to guarantee that you always get an array from a function, wrap the call with @(). $m = @(Get-AzureADGroupMember -ObjectId $g )$m.count will always be a number.