Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not display the first variable #26

Open
Pousla opened this issue Feb 18, 2021 · 0 comments
Open

Does not display the first variable #26

Pousla opened this issue Feb 18, 2021 · 0 comments

Comments

@Pousla
Copy link

Pousla commented Feb 18, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant