@@ -43,12 +43,12 @@ function Get-TenantGroups {
4343 }
4444
4545 if ($TenantFilter -and $TenantFilter -ne ' allTenants' ) {
46- $Results = New-Object System.Collections.ArrayList
46+ $Results = [ System.Collections.Generic.List [ PSCustomObject ]]::new()
4747 $Memberships = $AllMembers | Where-Object { $_.customerId -eq $Tenants.customerId }
4848 foreach ($Group in $Memberships ) {
4949 $Group = $Groups | Where-Object { $_.RowKey -eq $Group.GroupId }
5050 if ($Group ) {
51- $null = $ Results.Add ([PSCustomObject ]@ {
51+ $Results.Add ([PSCustomObject ]@ {
5252 Id = $Group.RowKey
5353 Name = $Group.Name
5454 Description = $Group.Description
@@ -57,15 +57,15 @@ function Get-TenantGroups {
5757 }
5858 return $Results | Sort-Object Name
5959 } else {
60- $Results = New-Object System.Collections.ArrayList
60+ $Results = [ System.Collections.Generic.List [ PSCustomObject ]]::new()
6161 foreach ($Group in $Groups ) {
6262 $Members = $AllMembers | Where-Object { $_.GroupId -eq $Group.RowKey }
63- $MembersList = New-Object System.Collections.ArrayList
63+ $MembersList = [ System.Collections.Generic.List [ hashtable ]]::new()
6464 if ($Members ) {
6565 foreach ($Member in $Members ) {
6666 $Tenant = $Tenants | Where-Object { $Member.customerId -eq $_.customerId }
6767 if ($Tenant ) {
68- $null = $ MembersList.Add (@ {
68+ $MembersList.Add (@ {
6969 customerId = $Tenant.customerId
7070 displayName = $Tenant.displayName
7171 defaultDomainName = $Tenant.defaultDomainName
@@ -76,7 +76,7 @@ function Get-TenantGroups {
7676 } else {
7777 $SortedMembers = @ ()
7878 }
79- $null = $ Results.Add ([PSCustomObject ]@ {
79+ $Results.Add ([PSCustomObject ]@ {
8080 Id = $Group.RowKey
8181 Name = $Group.Name
8282 Description = $Group.Description
0 commit comments