projects / mg-graph-helpers: paging and throttling, handled

mg-graph-helpers: paging and throttling, handled/

A small PowerShell module that wraps the parts of Microsoft Graph I reach for weekly — so paging, throttling, and scope checks stop being copy-paste.

version v0.1.0 status In development stack PowerShell
Version
v0.1.0
Status
In development
Updated
2026-05-11

Every Graph script I write starts the same way: a do/while around @odata.nextLink, a try/catch for HTTP 429, and a guess about which scopes the token needs. After the third copy-paste I made it a module.

What it does

  • PagingGet-MgPagedResult follows nextLink until the collection is exhausted and returns a flat array.
  • Throttling — honours the Retry-After header instead of sleeping a hard-coded number.
  • Scope detection — compares (Get-MgContext).Scopes against what the call needs and fails early with a readable message.

Status

v0.1.0, used in anger against two tenants. Not published yet — the error messages still assume you know what a nextLink is.