Skip to content

Commit

Permalink
add pagination option
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Nov 3, 2022
1 parent 6831821 commit 546620b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ExecGraphRequest/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ Function ConvertTo-FlatObject {
$TenantFilter = $Request.Query.TenantFilter
try {
if ($TenantFilter -ne 'AllTenants') {
$RawGraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/$($Request.Query.Endpoint)" -tenantid $TenantFilter -ComplexFilter
$RawGraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/$($Request.Query.Endpoint)" -tenantid $TenantFilter -NoPagination [boolean]$Request.query.DisablePagination -ComplexFilter
}
else {
$RawGraphRequest = Get-tenants | ForEach-Object {
try {
$DefaultDomainName = $_.defaultDomainName
$TenantName = $_.displayName
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/$($Request.Query.Endpoint)" -tenantid $DefaultDomainName -ComplexFilter
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/$($Request.Query.Endpoint)" -tenantid $DefaultDomainName -NoPagination [boolean]$Request.query.DisablePagination -ComplexFilter
}
catch {
continue
Expand Down

0 comments on commit 546620b

Please sign in to comment.