Skip to content

Commit fd20820

Browse files
committed
feat: add nopaginateids support to bulk requests
1 parent 79ea116 commit fd20820

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListGraphBulkRequest.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ function Invoke-ListGraphBulkRequest {
1515
$TenantFilter = $Request.Body.tenantFilter
1616
$AsApp = $Request.Body.asApp
1717
$Requests = $Request.Body.requests
18+
$NoPaginateIds = $Request.Body.noPaginateIds
1819

1920
$GraphRequestParams = @{
2021
tenantid = $TenantFilter
2122
Requests = @()
23+
NoPaginateIds = $NoPaginateIds ?? @()
2224
}
2325

2426
if ($AsApp) {

Modules/CIPPCore/Public/GraphHelper/New-GraphBulkRequest.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ function New-GraphBulkRequest {
88
$NoAuthCheck,
99
$scope,
1010
$asapp,
11-
$Requests
11+
$Requests,
12+
$NoPaginateIds = @()
1213
)
1314

1415
if ($NoAuthCheck -or (Get-AuthorisedRequest -Uri $uri -TenantID $tenantid)) {
@@ -43,6 +44,9 @@ function New-GraphBulkRequest {
4344
$Return
4445
}
4546
foreach ($MoreData in $ReturnedData.Responses | Where-Object { $_.body.'@odata.nextLink' }) {
47+
if ($NoPaginateIds -contains $MoreData.id) {
48+
continue
49+
}
4650
Write-Host 'Getting more'
4751
Write-Host $MoreData.body.'@odata.nextLink'
4852
$AdditionalValues = New-GraphGetRequest -ComplexFilter -uri $MoreData.body.'@odata.nextLink' -tenantid $tenantid -NoAuthCheck $NoAuthCheck -scope $scope -AsApp $asapp

0 commit comments

Comments
 (0)