Skip to content

This Module assists the creation of Batch Requests for Microsoft Graph by converting PSObjects to JSON with proper schema validation

License

Notifications You must be signed in to change notification settings

HCRitter/PSMSGraphBatchRequest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

PSMSGraphBatchRequest

The MSGraphBatchRequest PowerShell module provides a convenient way to transform data into Microsoft Graph Batch Requests by converting PowerShell objects to JSON with proper schema validation.

Features

  • Batch Request Schema: Enforces adherence to a specified JSON schema for Microsoft Graph Batch Requests.
  • Batch Size Control: Allows batching of requests based on a specified batch size.
  • Schema Validation: Validates the transformed JSON against the predefined schema.

Usage

$Calls = @(
    [PSCustomObject]@{
        id = '1'
        method = "GET"
        url = '/users/me'
    },
    [PSCustomObject]@{
        id = '2'
        method = "GET"
        url = '/devices'
    }
)

ConvertTo-MSGraphBatchRequest -Requests $Calls

returns:

{
  "requests": [
    {
      "id": "1",
      "method": "GET",
      "url": "/users/me"
    },
    {
      "id": "2",
      "method": "GET",
      "url": "/devices"
    }
  ]
}

About

This Module assists the creation of Batch Requests for Microsoft Graph by converting PSObjects to JSON with proper schema validation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published