Add-MgEnvironment
Adds Microsoft Graph environment to the settings file.
Syntax
Add-MgEnvironment
[-Name] <String>
[-AzureADEndpoint] <String>
[-GraphEndpoint] <String>
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Adds Microsoft Graph environment to the settings file.
Examples
Example 1: Add user defined environment
PS C:\> Add-MgEnvironment -Name "Canary" -GraphEndpoint "https://canary.graph.microsoft.com" -AzureADEndpoint "https://login.microsoftonline.com"
Name AzureADEndpoint GraphEndpoint Type
---- --------------- ------------- ----
Canary https://login.microsoftonline.com https://microsoftgraph.com User-defined
Adds user defined environment.
Parameters
-AzureADEndpoint
The base URL for Azure AD endpoint to get access tokens for Microsoft Graph endpoint.
Type: | String |
Aliases: | AzureADUrl |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GraphEndpoint
The service root endpoint for Microsoft Graph.
Type: | String |
Aliases: | GraphUrl |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
The environment name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProgressAction
{{ Fill ProgressAction Description }}
Type: | ActionPreference |
Aliases: | proga |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
System.String
Outputs
Microsoft.Graph.PowerShell.Authentication.Models.GraphEnvironment