Skip to content

Commit 14d3aea

Browse files
authored
Merge pull request #184 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 58d8408 + c08581b commit 14d3aea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Graph Requests/Push-ListGraphRequestQueue.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ function Push-ListGraphRequestQueue {
4040

4141
$RawGraphRequest = try {
4242
$Results = Get-GraphRequestList @GraphRequestParams
43-
$Results | Select-Object -First ($Results.Count - 1)
43+
if ($Results[-1].PSObject.Properties.Name -contains 'nextLink') {
44+
$Results | Select-Object -First ($Results.Count - 1)
45+
} else {
46+
$Results
47+
}
4448
} catch {
4549
$CippException = Get-CippException -Exception $_.Exception
4650
[PSCustomObject]@{
47-
Tenant = $Item.TenantFilter
48-
CippStatus = "Could not connect to tenant. $($CippException.NormalizedMessage)"
51+
Tenant = $Item.TenantFilter
52+
CippStatus = "Could not connect to tenant. $($CippException.NormalizedMessage)"
4953
CippException = [string]($CippException | ConvertTo-Json -Depth 10 -Compress)
5054
}
5155
}

0 commit comments

Comments
 (0)