DanielChronlund / DCToolbox

Tools for Microsoft cloud fans
314 stars 53 forks source link

Limiting results is not possible #2

Open ivandretvic opened 3 years ago

ivandretvic commented 3 years ago

When performing an API query, you cannot limit the results because it will always load @odata.nextlink. When testing queries its often useful to sample the results.

Eg. Running the following query should give you 5 results and is useful for sampling. https://graph.microsoft.com/beta/users?$limit=5&$select=userprincipalname,displayName,signInActivity,onPremisesDistinguishedName,accountEnabled

Current outcome - results are returned in full, but in page sizes of 5 results.

Possible solution - add a function parameter that, if set (eg -singlepageresults = $true), sets a the @uri variable to $null thus never running the loop more than once.