Skip to content

Does not display the first variable #26

@Pousla

Description

@Pousla

Hello,
The following script does not display the first variable of $GroupMember. I think the problem in on the module because I tried the script with different parameters (for example without the | where), the issue is still here. The list could be sort by different way, but the first $GroupMember still not displayed.

$GroupMember=""
$Groups = Get-AzureADGroup
foreach ($Group in $Groups) {
    $GroupMember = Get-AzureADGroupMember -ObjectId $Group.ObjectId | where {$_.UserType -eq 'Guest'}
    if ($GroupMember) {
        Write-Host `n "Group :" -ForegroundColor Green $Group.DisplayName "-" $Group.ObjectId
        $GroupMember | select DisplayName,UserPrincipalName,UserType
    }
}

I found a different way to display what I want, but it could be good to fix this issue :)
Tanks for help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions