mgx
1.0.2
Resilient companion for Microsoft.Graph PowerShell. Adds retry, circuit breaker, rate limiting, streaming pagination, batching, and fan-out to any Graph API endpoint.
Minimum PowerShell version
7.5
Installation Options
Owners
Copyright
(c) 2026 Thomas Maillo Grome. All rights reserved.
Package Details
Author(s)
- Thomas Maillo Grome
Tags
Microsoft Graph MicrosoftGraph API Azure EntraID Resilience PowerShell Polly Retry RateLimit Batch Delta Throttling Pagination
Cmdlets
Invoke-MgxRequest Invoke-MgxBatchRequest Export-MgxCollection Expand-MgxRelation Set-MgxOption Get-MgxOption Enable-MgxResilience Disable-MgxResilience Get-MgxResilience Get-MgxTelemetry Sync-MgxDelta
PSEditions
Dependencies
-
- Microsoft.Graph.Authentication (>= 2.10.0)
Release Notes
v1.0.2
- Fixed Linux install: renamed module files to lowercase so Install-Module works on case-sensitive filesystems
- Updated about_Mgx_Tuning version reference
v1.0.1
- Added tab completion for Uri parameter on all cmdlets
- Extracted CircuitBreakerMessage protected property on MgxCmdletBase
- Removed redundant XML doc comments on self-documenting members
v1.0.0 - Initial public release
v0.3.0 - Plug-and-play resilience
- NEW: Expand-MgxRelation: pipeline-composable relation enrichment
- Enrich Graph objects with related data via concurrent fan-out
- Auto-detects collection vs singleton endpoints (no silent data loss)
- -Top caps per-relation items (server-side $top + client-side truncation)
- -Flatten unwraps single-value relations, warns on multi-item
- -SkipNotFound/-SkipForbidden for partial failure tolerance
- Chaining: pipe through multiple Expand-MgxRelation stages
- NEW: Enable-MgxResilience / Disable-MgxResilience / Get-MgxResilience: zero-change resilience injection
- Wraps SDK HttpClient with Polly retry, circuit breaker, and rate limiting
- All Microsoft.Graph SDK cmdlets (Get-MgUser, etc.) gain resilience automatically
- Preserves full SDK handler chain (OData, NationalCloud, Redirect, Auth)
- Re-call after Connect-MgGraph to re-inject
- Thread-safe for concurrent runspaces
- Sovereign cloud support (auto-detects Graph endpoint)
- NEW: Get-MgxOption / Set-MgxOption: runtime resilience pipeline tuning
- 11 configurable parameters: rate limiting, retry, circuit breaker, timeouts
- CircuitBreakerSamplingDurationSeconds: control the failure measurement window (5-300s)
- Partial updates: only explicitly passed values are changed
- Set-MgxOption -Reset restores all defaults
- FIXED: Circuit breaker and rate limiter now shared across cmdlet invocations
- Previously created fresh per invocation, making both non-functional
- New ResiliencePipelineFactory manages shared static Polly pipeline
- FIXED: Rate limiter GC root leak on options change
- TokenBucketRateLimiter holds an internal Timer (GC root via AutoReplenishment)
- Old limiters now disposed after TotalTimeoutSeconds delay to avoid ObjectDisposedException
- FIXED: nextLink SSRF validation strengthened
- Rejects non-HTTPS scheme (prevents token leak over plaintext)
- Compares full authority (host + port), not just host
- ConcurrentFanOut rejects all nextLinks if initial URL parse fails
- FIXED: FindType() cache no longer caches null results
- Previously, importing Mgx before Microsoft.Graph permanently broke lookups
- IMPROVED: Request cloning copies Options, Version, and all content headers on retry
v0.2.0 - Restructure as companion module
- NEW: Invoke-MgxRequest: general-purpose resilient client for any Graph endpoint
- Streaming pagination with -All, -Top, -PageSize
- Fan-out concurrency with {id} template substitution
- Write operations (POST, PATCH, PUT, DELETE)
- -ApiVersion (v1.0/beta), -ConsistencyLevel, -NoPageSize
- -SkipNotFound/-SkipForbidden for fan-out error handling
- -Raw for JSON string output, -CheckpointPath for resume
- Progress reporting, pipeline stop support
- ArgumentCompleters for tab completion
- IMPROVED: @odata.type preserved as ODataType property (polymorphic queries)
- IMPROVED: DateTime strings parsed to DateTimeOffset
- NEW: Export-MgxCollection: JSONL streaming export with checkpoint/resume
- Raw JSON to disk, no PSObject overhead, constant memory
- -All, -Top, -CheckpointPath for resumable exports
- SupportsShouldProcess for -WhatIf/-Confirm
- IMPROVED: Set-MgxOption only overrides explicitly passed values
- FIXED: Set-MgxOption referenced deleted base class
- REMOVED: Get-MgxUser, Get-MgxGroup, Get-MgxGroupMember, Get-MgxApplication, Get-MgxServicePrincipal, Get-MgxDirectoryRole
- Use Invoke-MgxRequest '/users', '/groups', etc. instead
FileList
- mgx.nuspec
- mgx.psd1
- Mgx.Cmdlets.pdb
- Dependencies\Polly.Core.dll
- en-US\about_Mgx.help.txt
- help\Enable-MgxResilience.md
- help\Export-MgxCollection.md
- help\Set-MgxOption.md
- help\Invoke-MgxRequest.md
- help\Sync-MgxDelta.md
- mgx.Format.ps1xml
- Mgx.Cmdlets.dll
- Mgx.Cmdlets.deps.json
- Dependencies\System.Threading.RateLimiting.dll
- en-US\about_Mgx_Tuning.help.txt
- help\Get-MgxOption.md
- help\Invoke-MgxBatchRequest.md
- help\Get-MgxResilience.md
- help\Expand-MgxRelation.md
- help\Get-MgxTelemetry.md
- mgx.psm1
- Mgx.Engine.dll
- Mgx.Engine.pdb
- en-US\Mgx.Cmdlets.dll-Help.xml
- help\Disable-MgxResilience.md
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.2 (current version) | 8 | 4/21/2026 |
| 1.0.1 | 10 | 4/20/2026 |