|
| 1 | +--- |
| 2 | +external help file: Microsoft.Graph.Authentication.dll-Help.xml |
| 3 | +Module Name: Microsoft.Graph.Authentication |
| 4 | +online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/add-mgenvironment |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Add-MgEnvironment |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | + Adds Microsoft Graph environment to the settings file. |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +``` |
| 16 | +Add-MgEnvironment [-Name] <String> [-AzureADEndpoint] <String> [-GraphEndpoint] <String> [-WhatIf] [-Confirm] |
| 17 | + [<CommonParameters>] |
| 18 | +``` |
| 19 | + |
| 20 | +## DESCRIPTION |
| 21 | + Adds Microsoft Graph environment to the settings file. |
| 22 | + |
| 23 | +## EXAMPLES |
| 24 | + |
| 25 | +### Example 1: Add user defined environment |
| 26 | +```powershell |
| 27 | +PS C:\> Add-MgEnvironment -Name "Canary" -GraphEndpoint "https://canary.graph.microsoft.com" -AzureADEndpoint "https://login.microsoftonline.com" |
| 28 | +Name AzureADEndpoint GraphEndpoint Type |
| 29 | +---- --------------- ------------- ---- |
| 30 | +Canary https://login.microsoftonline.com https://microsoftgraph.com User-defined |
| 31 | +``` |
| 32 | + |
| 33 | +Adds user defined environment. |
| 34 | + |
| 35 | +## PARAMETERS |
| 36 | + |
| 37 | +### -AzureADEndpoint |
| 38 | +The base URL for Azure AD endpoint to get access tokens for Microsoft Graph endpoint. |
| 39 | + |
| 40 | +```yaml |
| 41 | +Type: String |
| 42 | +Parameter Sets: (All) |
| 43 | +Aliases: AzureADUrl |
| 44 | + |
| 45 | +Required: True |
| 46 | +Position: 1 |
| 47 | +Default value: None |
| 48 | +Accept pipeline input: True (ByPropertyName) |
| 49 | +Accept wildcard characters: False |
| 50 | +``` |
| 51 | +
|
| 52 | +### -GraphEndpoint |
| 53 | +The service root endpoint for Microsoft Graph. |
| 54 | +
|
| 55 | +```yaml |
| 56 | +Type: String |
| 57 | +Parameter Sets: (All) |
| 58 | +Aliases: GraphUrl |
| 59 | + |
| 60 | +Required: True |
| 61 | +Position: 2 |
| 62 | +Default value: None |
| 63 | +Accept pipeline input: True (ByPropertyName) |
| 64 | +Accept wildcard characters: False |
| 65 | +``` |
| 66 | +
|
| 67 | +### -Name |
| 68 | +The environment name. |
| 69 | +
|
| 70 | +```yaml |
| 71 | +Type: String |
| 72 | +Parameter Sets: (All) |
| 73 | +Aliases: |
| 74 | + |
| 75 | +Required: True |
| 76 | +Position: 0 |
| 77 | +Default value: None |
| 78 | +Accept pipeline input: True (ByPropertyName) |
| 79 | +Accept wildcard characters: False |
| 80 | +``` |
| 81 | +
|
| 82 | +### -Confirm |
| 83 | +Prompts you for confirmation before running the cmdlet. |
| 84 | +
|
| 85 | +```yaml |
| 86 | +Type: SwitchParameter |
| 87 | +Parameter Sets: (All) |
| 88 | +Aliases: cf |
| 89 | + |
| 90 | +Required: False |
| 91 | +Position: Named |
| 92 | +Default value: None |
| 93 | +Accept pipeline input: False |
| 94 | +Accept wildcard characters: False |
| 95 | +``` |
| 96 | +
|
| 97 | +### -WhatIf |
| 98 | +Shows what would happen if the cmdlet runs. |
| 99 | +The cmdlet is not run. |
| 100 | +
|
| 101 | +```yaml |
| 102 | +Type: SwitchParameter |
| 103 | +Parameter Sets: (All) |
| 104 | +Aliases: wi |
| 105 | + |
| 106 | +Required: False |
| 107 | +Position: Named |
| 108 | +Default value: None |
| 109 | +Accept pipeline input: False |
| 110 | +Accept wildcard characters: False |
| 111 | +``` |
| 112 | +
|
| 113 | +### CommonParameters |
| 114 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 115 | +
|
| 116 | +## INPUTS |
| 117 | +
|
| 118 | +### System.String |
| 119 | +
|
| 120 | +## OUTPUTS |
| 121 | +
|
| 122 | +### Microsoft.Graph.PowerShell.Authentication.Models.GraphEnvironment |
| 123 | +
|
| 124 | +## NOTES |
| 125 | +
|
| 126 | +## RELATED LINKS |
| 127 | +
|
| 128 | +[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/add-mgenvironment](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/add-mgenvironment) |
| 129 | +
|
0 commit comments