Skip to content

Latest commit

 

History

History
130 lines (100 loc) · 3.01 KB

Add-Mga.md

File metadata and controls

130 lines (100 loc) · 3.01 KB
external help file Module Name online version schema
Optimized.Mga-help.xml
Optimized.Mga
2.0.0

Add-Mga

SYNOPSIS

Add-Mga is an Alias for the method Put.

SYNTAX

Add-Mga [-Uri] <String> [-Body <Object>] [-Api <String>] [-CustomHeader <Object>] [-ReturnAsJson]
 [<CommonParameters>]

DESCRIPTION

Creates a new object in the Azure AD tenant with the Microsoft Graph API.

EXAMPLES

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: String
Parameter Sets: (All)
Aliases: URL

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

-Body

Body will accept a PSObject or a Json string.

Type: Object
Parameter Sets: (All)
Aliases: InputObject

Required: False
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: (All)
Aliases: Reference

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

-CustomHeader

This not a not mandatory parameter, there is a default header containing application/json. By using this parameter you can add a custom header. The CustomHeader is reverted back to the original after the cmdlet has run.

Type: Object
Parameter Sets: (All)
Aliases:

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

-ReturnAsJson

This is not a mandatory parameter. By using, this the output will be returned as Json. When it cannot be converted to json, it will be returned as is.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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

The method Put is currently only used for uploading files to Sharepoint. Examples: https://baswijdenes.com/how-to-upload-files-to-sharepoint-with-ms-graph-api-and-powershell/

RELATED LINKS

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

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