Skip to content

Commit 4158958

Browse files
Copilotgavinbarron
andcommitted
Fix PowerShell test to use DelosCloud instead of removed Germany environment
Co-authored-by: gavinbarron <7122716+gavinbarron@users.noreply.github.com>
1 parent 4e5b70d commit 4158958

21 files changed

+130
-208
lines changed

src/Authentication/Authentication.Core/Microsoft.Graph.Authentication.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<LangVersion>9.0</LangVersion>
55
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
66
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
7-
<Version>2.32.0</Version>
7+
<Version>2.35.1</Version>
88
<!-- Suppress .NET Target Framework Moniker (TFM) Support Build Warnings -->
99
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
1010
</PropertyGroup>

src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>net8.0;net472</TargetFrameworks>
44
<IsPackable>false</IsPackable>
5-
<Version>2.32.0</Version>
5+
<Version>2.35.1</Version>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />

src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<WarningsAsErrors />
1111
<NuspecFile>Microsoft.Graph.Authentication.nuspec</NuspecFile>
1212
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
13-
<Version>2.32.0</Version>
13+
<Version>2.35.1</Version>
1414
</PropertyGroup>
1515
<PropertyGroup>
1616
<EnableNETAnalyzers>true</EnableNETAnalyzers>

src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<metadata>
4-
<version>2.32.0</version>
4+
<version>2.35.1</version>
55
<id>Microsoft.Graph.Authentication</id>
66
<description>Microsoft Graph PowerShell authentication module</description>
77
<authors>Microsoft</authors>

src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft
55
#
6-
# Generated on: 21/09/2023
6+
# Generated on: 02/12/2026
77
#
88

99
@{
@@ -12,13 +12,13 @@
1212
RootModule = './Microsoft.Graph.Authentication.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.6.1'
15+
ModuleVersion = '2.35.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
1919

2020
# ID used to uniquely identify this module
21-
GUID = '883916f2-9184-46ee-b1f8-b6a2fb784cee'
21+
GUID = '44776453-fc06-4f89-94c9-f0bd6578afa1'
2222

2323
# Author of this module
2424
Author = 'Microsoft'

src/Authentication/Authentication/test/Get-MgContext.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Describe 'Get-MgContext' {
2727

2828

2929
It 'Should return the correct environment when specified via Connect-MgGraph -Environment' {
30-
Connect-MgGraph -AccessToken (ConvertTo-SecureString -AsPlainText -String $DummyToken) -Environment Germany
30+
Connect-MgGraph -AccessToken (ConvertTo-SecureString -AsPlainText -String $DummyToken) -Environment DelosCloud
3131
$Context = Get-MgContext
3232
$Context | Should -Not -Be $null
33-
$Context.Environment | Should -Be "Germany"
33+
$Context.Environment | Should -Be "DelosCloud"
3434
$Context.AuthType | Should -Be "UserProvidedAccessToken"
3535
}
3636
}

src/Authentication/docs/Add-MgEnvironment.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Graph.Authentication.dll-Help.xml
33
Module Name: Microsoft.Graph.Authentication
44
online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/add-mgenvironment
@@ -7,31 +7,27 @@ schema: 2.0.0
77

88
# Add-MgEnvironment
99

10-
## SYNOPSIS
11-
Adds Microsoft Graph environment to the settings file.
12-
10+
## SYNOPSIS
11+
Adds Microsoft Graph environment to the settings file.
1312
## SYNTAX
1413

1514
```
1615
Add-MgEnvironment [-Name] <String> [-AzureADEndpoint] <String> [-GraphEndpoint] <String> [-WhatIf] [-Confirm]
1716
[<CommonParameters>]
1817
```
1918

20-
## DESCRIPTION
21-
Adds Microsoft Graph environment to the settings file.
22-
23-
## EXAMPLES
24-
19+
## DESCRIPTION
20+
Adds Microsoft Graph environment to the settings file.
21+
## EXAMPLES
2522
### Example 1: Add user defined environment
2623
```powershell
2724
PS C:\> Add-MgEnvironment -Name "Canary" -GraphEndpoint "https://canary.graph.microsoft.com" -AzureADEndpoint "https://login.microsoftonline.com"
2825
Name AzureADEndpoint GraphEndpoint Type
2926
---- --------------- ------------- ----
3027
Canary https://login.microsoftonline.com https://microsoftgraph.com User-defined
3128
```
32-
3329
Adds user defined environment.
34-
30+
3531
## PARAMETERS
3632

3733
### -AzureADEndpoint
@@ -125,5 +121,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
125121
126122
## RELATED LINKS
127123
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-
124+
[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

src/Authentication/docs/Connect-MgGraph.md

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Graph.Authentication.dll-Help.xml
33
Module Name: Microsoft.Graph.Authentication
44
online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph
@@ -7,9 +7,8 @@ schema: 2.0.0
77

88
# Connect-MgGraph
99

10-
## SYNOPSIS
11-
Microsoft Graph PowerShell supports two types of authentication: delegated and app-only access. There are a number of cmdlets that can be used to manage the different parameters required during authentication, for example, environment, application ID, and certificate.
12-
10+
## SYNOPSIS
11+
Microsoft Graph PowerShell supports two types of authentication: delegated and app-only access. There are a number of cmdlets that can be used to manage the different parameters required during authentication, for example, environment, application ID, and certificate.
1312
## SYNTAX
1413

1514
### UserParameterSet (Default)
@@ -50,82 +49,71 @@ Connect-MgGraph [-ContextScope <ContextScope>] [-Environment <String>] [-ClientT
5049
[-EnvironmentVariable] [-NoWelcome] [<CommonParameters>]
5150
```
5251

53-
## DESCRIPTION
54-
You must invoke Connect-MgGraph before any commands that access Microsoft Graph. This cmdlet gets the access token using the Microsoft Authentication Library
55-
56-
## EXAMPLES
57-
52+
## DESCRIPTION
53+
You must invoke Connect-MgGraph before any commands that access Microsoft Graph. This cmdlet gets the access token using the Microsoft Authentication Library
54+
## EXAMPLES
5855
### Example 1: Delegated access: Using interactive authentication, where you provide the scopes that you require during your session
5956
```powershell
6057
PS C:\> Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
6158
```
62-
6359
This example shows how to authenticate to graph with scopes.
6460

6561
### Example 2: Delegated access: Using device code flow
6662
```powershell
6763
PS C:\> Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All" -UseDeviceAuthentication
6864
```
69-
7065
This example shows how to authenticate to graph with scopes and device.
7166

7267
### Example 3: Delegated access: Using your own access token
7368
```powershell
7469
PS C:\> Connect-MgGraph -AccessToken $AccessToken
7570
```
76-
7771
This example shows how to authenticate to graph using an access token.
7872

7973
### Example 4: Delegated access: custom application for Microsoft Graph PowerShell
8074
```powershell
8175
PS C:\> Connect-MgGraph -ClientId <YOUR_NEW_APP_ID> -TenantId <YOUR_TENANT_ID>
8276
```
83-
8477
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on the steps for creating custom applications.
8578

8679
### Example 5: App-only access: Using client credential with a certificate - Certificate Thumbprint
8780
```powershell
8881
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
8982
```
90-
9183
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
9284

9385
### Example 6: App-only access: Using client credential with a certificate - Certificate name
9486
```powershell
9587
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
9688
```
97-
9889
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
9990

10091
### Example 7: App-only access: Using client credential with a certificate - Certificate
10192
```powershell
10293
PS C:\> $Cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint
10394
PS C:\> Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -Certificate $Cert
10495
```
105-
10696
Follow this [link](https://learn.microsoft.com/en-us/powershell/microsoftgraph/authentication-commands?view=graph-powershell-1.0#using-connect-mggraph) for more information on how to load the certificate.
10797

98+
10899
### Example 8: Using client secret credentials
109100
```powershell
110101
PS C:\> $ClientSecretCredential = Get-Credential -Credential "Client_Id"
111102
# Enter client_secret in the password prompt.
112103
PS C:\> Connect-MgGraph -TenantId "Tenant_Id" -ClientSecretCredential $ClientSecretCredential
113104
```
114-
115105
This authentication method is ideal for background interactions. It does not require a user to physically sign in.
116106

117107
### Example 9: Using managed identity: System-assigned managed identity
118108
```powershell
119109
PS C:\> Connect-MgGraph -Identity
120110
```
121-
122111
Uses an automatically managed identity on a service instance. The identity is tied to the lifecycle of a service instance.
123112

124113
### Example 10: Using managed identity: User-assigned managed identity
125114
```powershell
126115
PS C:\> Connect-MgGraph -Identity -ClientId "User_Assigned_Managed_identity_Client_Id"
127116
```
128-
129117
Uses a user created managed identity as a standalone Azure resource.
130118

131119
### Example 11: Connecting to an environment or cloud
@@ -139,16 +127,14 @@ USGov https://login.microsoftonline.us https://graph.microsoft.us
139127
USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Built-in
140128
PS C:\> Connect-MgGraph -Environment USGov
141129
```
142-
143130
When you use Connect-MgGraph, you can choose to target other environments. By default, Connect-MgGraph targets the global public cloud.
144131

145132
### Example 12: Connecting to an environment as a different identity
146133
```powershell
147134
PS C:\> Connect-MgGraph -ContextScope Process
148135
```
149-
150136
To connect as a different identity other than CurrentUser, specify the -ContextScope parameter with the value Process.
151-
137+
152138
## PARAMETERS
153139

154140
### -AccessToken
@@ -412,5 +398,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
412398
413399
## RELATED LINKS
414400
415-
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph)
416-
401+
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/connect-mggraph
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Graph.Authentication.dll-Help.xml
33
Module Name: Microsoft.Graph.Authentication
44
online version: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/disconnect-graph
@@ -7,27 +7,24 @@ schema: 2.0.0
77

88
# Disconnect-MgGraph
99

10-
## SYNOPSIS
11-
Once you're signed in, you'll remain signed in until you invoke Disconnect-MgGraph. Microsoft Graph PowerShell automatically refreshes the access token for you and sign-in persists across PowerShell sessions because Microsoft Graph PowerShell securely caches the token.
12-
10+
## SYNOPSIS
11+
Once you're signed in, you'll remain signed in until you invoke Disconnect-MgGraph. Microsoft Graph PowerShell automatically refreshes the access token for you and sign-in persists across PowerShell sessions because Microsoft Graph PowerShell securely caches the token.
1312
## SYNTAX
1413

1514
```
1615
Disconnect-MgGraph [<CommonParameters>]
1716
```
1817

19-
## DESCRIPTION
20-
Use Disconnect-MgGraph to sign out.
21-
22-
## EXAMPLES
18+
## DESCRIPTION
19+
Use Disconnect-MgGraph to sign out.
20+
## EXAMPLES
2321

2422
### Example 1: Using Disconnect-MgGraph
2523
```powershell
2624
PS C:\> Disconnect-MgGraph
2725
```
28-
2926
Use Disconnect-MgGraph to sign out.
30-
27+
3128
## PARAMETERS
3229

3330
### CommonParameters
@@ -43,5 +40,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
4340

4441
## RELATED LINKS
4542

46-
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/disconnect-graph](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/disconnect-graph)
47-
43+
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/disconnect-graph](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/disconnect-graph

src/Authentication/docs/Find-MgGraphCommand.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ schema: 2.0.0
77

88
# Find-MgGraphCommand
99

10-
## SYNOPSIS
11-
Find-MgGraphCommand aims to make it easier for you to discover which API path a command calls, by providing a URI or a command name. The Find-MgGraphCommand allows to: - Pass a Microsoft Graph URL (relative and absolute) and get an equivalent Microsoft Graph PowerShell command. - Pass a command and get the URL it calls. - Pass a command or URI wildcard (.*) to find all commands that match it.
12-
10+
## SYNOPSIS
11+
Find-MgGraphCommand aims to make it easier for you to discover which API path a command calls, by providing a URI or a command name. The Find-MgGraphCommand allows to: - Pass a Microsoft Graph URL (relative and absolute) and get an equivalent Microsoft Graph PowerShell command. - Pass a command and get the URL it calls. - Pass a command or URI wildcard (.*) to find all commands that match it.
1312
## SYNTAX
1413

1514
### FindByCommandOrUri (Default)
@@ -30,11 +29,9 @@ Find-MgGraphCommand [-ApiVersion <String>] -Command <String[]> [-ProgressAction
3029
[<CommonParameters>]
3130
```
3231

33-
## DESCRIPTION
34-
Find-MgGraphCommand aims to make it easier for you to discover which API path a command calls, by providing a URI or a command name.
35-
36-
## EXAMPLES
37-
32+
## DESCRIPTION
33+
Find-MgGraphCommand aims to make it easier for you to discover which API path a command calls, by providing a URI or a command name.
34+
## EXAMPLES
3835
### Example 1: Use a URI to get all related cmdlets
3936
```powershell
4037
PS C:\> Find-MgGraphCommand -Uri "/users/{id}"
@@ -55,8 +52,8 @@ Command Module Method URI OutputType Permissions
5552
Get-MgUser Users GET /users/{user-id} IMicrosoftGraphUser {DeviceManagementApps.Read.All, DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All...} {Get, GetViaIdentity}
5653
Remove-MgUser Users DELETE /users/{user-id} {DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, Directory.AccessAsUser.All} {Delete1, DeleteViaIdentity1}
5754
Update-MgUser Users PATCH /users/{user-id} {DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, Directory.AccessAsUser.All...} {Update1, UpdateExpanded1, UpdateViaIdentity1, UpdateViaIdentityExpanded1}
58-
```
5955
56+
```
6057
This example finds all commands that call the provided Microsoft Graph URI.
6158

6259
### Example 2: Pass a command and get the URI it calls
@@ -78,7 +75,6 @@ Command Module Method URI OutputType Permissions
7875
Get-MgUser Users GET /users/{user-id} IMicrosoftGraphUser {DeviceManagementApps.Read.All, DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All...} {Get, GetViaIdentity}
7976
Get-MgUser Users GET /users IMicrosoftGraphUser {DeviceManagementApps.Read.All, DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All...} {List}
8077
```
81-
8278
This example looks up a command with the provided command name that calls both beta and v1.0 version of the API.
8379

8480
### Example 3: Pass a command and get the permissions required
@@ -94,7 +90,6 @@ User.Read.All True Read all users' full profil
9490
User.ReadBasic.All False Read all users' basic profiles Allows the app to read a basic set of profile properties of other users in your organization on your behalf. Includes display name, first and last name, email address a...
9591
User.ReadWrite.All True Read and write all users' full profiles Allows the app to read and write the full set of profile properties, reports, and managers of other users in your organization, on your behalf.
9692
```
97-
9893
This example retrieves the scopes required for a particular command.
9994

10095
### Example 4: Find Microsoft Graph PowerShell commands using a command wildcard
@@ -112,7 +107,6 @@ Get-MgUserTodoListExtension Users GET /users/{us
112107
Get-MgUserTodoListTask Users GET /users/{user-id}/todo/lists/{todoTaskList-id}/tasks
113108
Get-MgUserTodoListTask Users GET /users/{user-id}/todo/lists/{todoTaskList-id}/tasks/{todoTask-id}
114109
```
115-
116110
Uses a wildcard syntax to search for commands.
117111

118112
### Example 5: Find Microsoft Graph PowerShell commands using a URI wildcard
@@ -126,9 +120,8 @@ Get-MgUserActivity CrossDeviceExperiences GET /users
126120
Get-MgUserActivity CrossDeviceExperiences GET /users/{user-id}/activities
127121
Get-MgUserActivityHistoryItem CrossDeviceExperiences GET /users/{user-id}/activities/{userActivity-id}/historyItems/{activityHistoryItem-id}
128122
```
129-
130123
Searches for commands using URI wildcard.
131-
124+
132125
## PARAMETERS
133126

134127
### -ApiVersion
@@ -241,5 +234,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
241234
242235
## RELATED LINKS
243236
244-
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/find-mggraphcommand](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/find-mggraphcommand)
245-
237+
[https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/find-mggraphcommand](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.authentication/find-mggraphcommand

0 commit comments

Comments
 (0)