Skip to content

Command Reference

Jiri Formacek edited this page Jul 4, 2026 · 1 revision

Command Reference

Quick-reference table of all commands exported by the GraphApiHelper module.

All Exported Commands

Command Category Description
Set-GraphAadFactory Configuration Sets the AadAuthenticationFactory instance used for token acquisition.
Set-GraphScopes Configuration Sets the OAuth2 scopes requested when obtaining access tokens.
Set-GraphBaseUri Configuration Sets the base URI prepended to relative Graph paths (must include version segment).
Set-GraphAiLogger Configuration Attaches an AiLogger instance for Application Insights telemetry.
Get-GraphAuthorizationHeader Authentication Returns a hashtable with the Authorization: Bearer header.
Get-GraphData Data Retrieval GET with automatic @odata.nextLink pagination. Returns the full dataset.
Invoke-GraphWithRetry Data Retrieval Single Graph request (GET/POST/PUT/PATCH/DELETE) with retry logic.
New-GraphUri URL Building Builds an absolute or relative Graph URL with OData query options.
New-GraphBatchRequest Batch Creates a subrequest object for a Graph /$batch payload.
Invoke-GraphBatch Batch Sends up to 20 subrequests in a single /$batch call.
Add-GraphReference Directory Adds a member or owner $ref link to a group, application, or service principal.
Remove-GraphReference Directory Removes a member or owner $ref link.
Get-GraphReferenceUri Directory Builds a directoryObjects reference URI from an object ID.
Add-GraphLargeFile File Upload Uploads a local file using the Graph resumable upload session protocol.
ConvertFrom-GraphErrorRecord Error Handling Extracts the Graph JSON error payload from a PowerShell ErrorRecord.

Common Aliases

Alias Resolves To
-Uri -RequestUri (on Get-GraphData, Invoke-GraphWithRetry)
-Requests -BatchRequest (on Invoke-GraphBatch)

Module Defaults

Setting Default
Authentication factory name graph
Base URI https://graph.microsoft.com/v1.0
Scope https://graph.microsoft.com/.default
AI logger $null (disabled)
Retry codes 429
Max retries 100
Default back-off 1 second

Installation

Install-Module AadAuthenticationFactory   # required
Install-Module AiLogger                   # optional telemetry
Install-Module GraphApiHelper

Module Information

Property Value
Module version 1.0.10
PowerShell compatibility Core
Author Jiri Formacek
Company GreyCorbel Solutions
PSGallery GraphApiHelper
Project github.com/GreyCorbel/GraphApiHelper

GraphApiHelper

Configuration

Making API Calls

Directory Objects

Files

Diagnostics

Reference

Clone this wiki locally