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:
@@ -296,7 +296,7 @@ Write-Host "Selected $($selectedObjects.Count) objects." -ForegroundColor Green
|
||||
#region Load groups & filters
|
||||
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
|
||||
|
||||
Write-Host "`nLoading assignment filters..." -ForegroundColor Cyan
|
||||
|
||||
Reference in New Issue
Block a user