Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/HCRitter/PSMSGraphBatchRequest

This Module assists the creation of Batch Requests for Microsoft Graph by converting PSObjects to JSON with proper schema validation
https://github.com/HCRitter/PSMSGraphBatchRequest

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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
```PowerShell
$Calls = @(
[PSCustomObject]@{
id = '1'
method = "GET"
url = '/users/me'
},
[PSCustomObject]@{
id = '2'
method = "GET"
url = '/devices'
}
)

ConvertTo-MSGraphBatchRequest -Requests $Calls
```
returns:
```json
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "/users/me"
},
{
"id": "2",
"method": "GET",
"url": "/devices"
}
]
}
```