Skip to content

Commit 19c2893

Browse files
committed
fix classic function
1 parent aefbb65 commit 19c2893

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ function New-ClassicAPIGetRequest($TenantID, $Uri, $Method = 'GET', $Resource =
1818
'X-Requested-With' = 'XMLHttpRequest'
1919
}
2020
$Data
21-
if ($noPagination) { $nextURL = $null } else { $nextURL = $data.NextLink }
21+
if ($noPagination -or $null -eq $data.NextLink) { $nextURL = $null } else { $nextURL = $data.NextLink }
2222
} catch {
2323
throw "Failed to make Classic Get Request $_"
2424
}
25-
} until ($null -eq $NextURL)
25+
} until ($null -eq $NextURL -or ' ' -eq $NextURL)
2626
return $ReturnedData
2727
} else {
2828
Write-Error 'Not allowed. You cannot manage your own tenant or tenants not under your scope'
2929
}
30-
}
30+
}

0 commit comments

Comments
 (0)