Skip to content

Latest commit

 

History

History
165 lines (128 loc) · 3.37 KB

Invoke-Mga.md

File metadata and controls

165 lines (128 loc) · 3.37 KB
external help file Module Name online version schema
Optimized.Mga-help.xml
Optimized.Mga
2.0.0

Invoke-Mga

SYNOPSIS

Invoke-Mga is a wrapper around the default Method cmdlets in the Mga module.

SYNTAX

Default (Default)

Invoke-Mga -Uri <Object> [-Body <Object>] -Method <Object> [-Api <String>] [<CommonParameters>]

Batch

Invoke-Mga [-Uri <Object>] -Body <Object> -Method <Object> [<CommonParameters>]

DESCRIPTION

By using Invoke-Mga you do not have to change the way you use the default Method cmdlets in the Mga module.

EXAMPLES

EXAMPLE 1

Invoke-Mga -Uri 'https://graph.microsoft.com/v1.0/users' -Method 'GET'

EXAMPLE 2

Invoke-Mga -Uri '/users' -Method 'Post' -Api 'beta' -Body $Body

EXAMPLE 3

Invoke-Mga -Uri 'https://graph.microsoft.com/beta/groups' -Method 'Patch' -Api 'v1.0' -Body $Body

EXAMPLE 4

Invoke-Mga -Uri 'beta/groups' -Method 'Delete' -Api 'All'

EXAMPLE 5

Invoke-Mga -Method 'Batch' -Body $Body

PARAMETERS

-Uri

Uri to the Microsoft Graph API. You can also use the last part of an Uri and the rest will be automatically added. Example: /users Example: https://graph.microsoft.com/v1.0/users Example: users?$filter=displayName eq 'Bas Wijdenes' Example: beta/users

Type: Object
Parameter Sets: Default
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: Object
Parameter Sets: Batch
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Body

Body will accept a PSObject, or a Json string for Post, Patch, Put, and Delete. Body will accept an ArrayList for Batch.

Type: Object
Parameter Sets: Default
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: Object
Parameter Sets: Batch
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Method

Type of Method to the Microsoft Graph Endpoint. Methods are: Get, Post, Patch, Put, Delete, Batch.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Api

This is not a mandatory parameter. By using v1.0 or beta it will always overwrite the value given in the Uri. By using All it will first try v1.0 in a try and catch. and when it jumps to the catch it will use the beta Api.

Type: String
Parameter Sets: Default
Aliases: Reference

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://github.com/baswijdenes/Optimized.Mga/

https://baswijdenes.com/c/microsoft/mga/