fix: fetch all groups via -AllPages for large tenants
Replaces default 100-item page limits and =999 workarounds with -AllPages on group queries across assignment and baseline scripts. Enables full fzf inline search/filter for group selection.
This commit is contained in:
@@ -277,9 +277,9 @@ if($Mode -eq "Backup")
|
||||
|
||||
# Preload groups for name resolution in backup
|
||||
Write-Host "`nLoading groups for backup resolution..." -ForegroundColor Cyan
|
||||
$backupGroupsResponse = Invoke-GraphRequest "/groups?`$select=id,displayName&`$top=999"
|
||||
$backupGroupsResponse = Invoke-GraphRequest "/groups?`$select=id,displayName&`$orderby=displayName" -AllPages
|
||||
$backupGroups = @{}
|
||||
foreach($g in $backupGroupsResponse.value)
|
||||
foreach($g in $backupGroupsResponse)
|
||||
{
|
||||
$backupGroups[$g.id] = $g.displayName
|
||||
}
|
||||
@@ -382,8 +382,8 @@ elseif($Mode -eq "Restore")
|
||||
|
||||
# Resolve group names to IDs in current tenant if needed
|
||||
Write-Host "`nLoading current tenant groups for name resolution..." -ForegroundColor Cyan
|
||||
$currentGroupsResponse = Invoke-GraphRequest "/groups?`$select=id,displayName&`$top=999"
|
||||
$currentGroups = $currentGroupsResponse.value
|
||||
$currentGroupsResponse = Invoke-GraphRequest "/groups?`$select=id,displayName&`$orderby=displayName" -AllPages
|
||||
$currentGroups = $currentGroupsResponse
|
||||
|
||||
$success = 0
|
||||
$skipped = 0
|
||||
|
||||
Reference in New Issue
Block a user