fix: restore .value access when using -AllPages on group queries
Invoke-GraphRequest with -AllPages returns the full response object with accumulated items in .value, not a flat array.
This commit is contained in:
@@ -253,7 +253,7 @@ Write-Host "Selected $($selectedApps.Count) apps." -ForegroundColor Green
|
||||
#region Load Groups
|
||||
Write-Host "`nLoading Azure AD groups..." -ForegroundColor Cyan
|
||||
$groupsResponse = Invoke-GraphRequest "/groups?`$select=id,displayName&`$orderby=displayName" -AllPages
|
||||
$groups = $groupsResponse | Where-Object { $_.displayName } | Sort-Object displayName
|
||||
$groups = $groupsResponse.value | Where-Object { $_.displayName } | Sort-Object displayName
|
||||
Write-Host "Found $($groups.Count) groups." -ForegroundColor Green
|
||||
|
||||
$groupDisplayNames = $groups | ForEach-Object { "$($_.displayName) [$($_.id)]" }
|
||||
|
||||
Reference in New Issue
Block a user