Skip to content

Commit 95df2cf

Browse files
authored
Merge branch 'dev' into getmgdomain-typo
2 parents e7f3832 + 36d4eba commit 95df2cf

File tree

3 files changed

+64
-20
lines changed

3 files changed

+64
-20
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
Consume <a href="https://graph.microsoft.com">Microsoft Graph</a> resources directly from your PowerShell scripts
88
</h4>
99

10-
<h3 align="center"><a href="https://learn.microsoft.com/powershell/microsoftgraph/overview">Documentation</a></h3>
10+
<h3 align="center"><a href="https://learn.microsoft.com/graph/overview">API Documentation</a> | <a href="https://learn.microsoft.com/powershell/microsoftgraph/overview">SDK Documentation</a></h3>
1111

1212
<p align="center">
13-
The Microsoft Graph PowerShell module consists of a collection of PowerShell modules that contain commands for calling Microsoft Graph API. The module acts as an API wrapper for the Microsoft Graph APIs, exposing the entire API set for use in PowerShell.
13+
The Microsoft Graph PowerShell SDK is made up of a set of modules that enable you to interact with the Microsoft Graph API using PowerShell commands. The modules consist of commands that act as wrappers for the API, allowing you to access all the features and functionality of the API through PowerShell.
1414
</p>
1515

1616
<p align="center">
@@ -44,7 +44,7 @@ Microsoft Graph PowerShell module is published on [PowerShell Gallery](https://w
4444
Install-Module Microsoft.Graph
4545
```
4646

47-
> Run `Install-Module` with AllowClobber and Force parameters if you run into command name conflicts when upgrading to older versions of the module:
47+
> Run `Install-Module` with `-AllowClobber` and `-Force` parameters if you run into command name conflicts when upgrading to older versions of the module. This may be the case when upgrading from v1.x to v2.x:
4848
>
4949
> ```powershell
5050
> Install-Module Microsoft.Graph -AllowClobber -Force
@@ -122,10 +122,12 @@ The following breaking changes have been introduced between `v1.x` and `v2.x`:
122122
- Dropped profile support.
123123
- Dropped support for `-ForceRefresh` on `Connect-MgGraph`.
124124
- Renamed `beta` command names from `<Verb>-Mg<Noun>` to `<Verb>-MgBeta<Noun>`.
125+
- Renamed `DeviceManagement.Enrolment` module to `DeviceManagement.Enrollment`.
126+
- Moved directory role and entitlement management commands from `DeviceManagement.Enrollment` to `Identity.Governance` module.
125127
- Changed beta namespace from `Microsoft.Graph.PowerShell.Models.<Entity>` to `Microsoft.Graph.Beta.PowerShell.Models.<Entity>`.
126128
- Changed `-AccessToken` type on `Connect-MgGraph` from `String` to `SecureString`.
127129

128-
See [v2 upgrade guide](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/features/2.0/docs/upgrade-to-v2.md) for more details.
130+
See the [v2 upgrade guide](./docs/upgrade-to-v2.md) for more details.
129131

130132
## Troubleshooting
131133

@@ -135,13 +137,15 @@ When working with various operations in the Graph, you may encounter an error su
135137

136138
If permission-related errors occur and the signed-in user/app has been granted the appropriate permissions to perform the operation, you can explicitly fetch a new access token by running `Disconnect-MgGraph`, then `Connect-MgGraph`. This will trigger a refresh of the access token in your cache. Microsoft Authentication Library (MSAL) will only refresh access tokens in your cache if they have expired (usually an hour).
137139

140+
See [Microsoft Graph API Permissions Reference](https://learn.microsoft.com/graph/permissions-reference) for more details.
141+
138142
### Common Errors
139143

140144
See our [troubleshooting guide](https://learn.microsoft.com/powershell/microsoftgraph/troubleshooting) for a detailed view of how to troubleshoot common errors when using Microsoft Graph.
141145

142146
## Known Issues
143147

144-
- Using `-Property {PropertyName}` parameter will not select the property as the output of the command. All commands return CLR objects, and customers should pipe the command outputs to `Format-Table` or `Select-Object` to return individual properties.
148+
- Using the `-Property {PropertyName}` parameter will not select the property as the output of the command. All commands return CLR objects, and customers should pipe the command outputs to `Format-Table` or `Select-Object` to return individual properties.
145149

146150
- Customers upgrading from previous versions of the SDK may encounter auth prompts on every command call. If this happens, one can use the following steps to reset their token cache:
147151
- Use `Disconnect-MgGraph` to sign out of the current session.

docs/authentication.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@ The Microsoft Graph PowerShell module supports two types of authentication:
55
- Delegated Access
66
- App-only Access
77

8-
## Web Account Manager (WAM)
9-
WAM is a Windows 10+ component that acts as an authentication broker allowing the users of an app benefit from integration with accounts known to Windows, such as the account already signed into an active Windows session.
10-
11-
Microsoft Graph PowerShell module supports WAM in the following scenraio:
12-
13-
- To enable WAM on supported devices
14-
```PowerShell
15-
Set-MgGraphOption -EnableLoginByWAM $true
16-
```
17-
18-
- To disable WAM on supported devices
19-
```PowerShell
20-
Set-MgGraphOption -EnableLoginByWAM $false
21-
```
228
## Delegated Access
239

2410
Delegated access uses a public client to get an access token and consume Microsoft Graph resources on behalf of the signed-in user.
@@ -125,3 +111,21 @@ When using `-AccessToken`, we won't have access to the refresh token and the cli
125111
### Access Token Scopes (scp) Claims
126112

127113
Before using the provided `-AccessToken` to get Microsoft Graph resources, customers should ensure that the access token has the necessary scopes/ permissions needed to access/modify a resource.
114+
115+
## Web Account Manager (WAM)
116+
117+
WAM is a Windows 10+ component that acts as an authentication broker allowing the users of an app benefit from integration with accounts known to Windows, such as the account already signed into an active Windows session.
118+
119+
Microsoft Graph PowerShell module supports WAM in the following scenario:
120+
121+
- To enable WAM on supported devices
122+
123+
```PowerShell
124+
Set-MgGraphOption -EnableLoginByWAM $true
125+
```
126+
127+
- To disable WAM on supported devices
128+
129+
```PowerShell
130+
Set-MgGraphOption -EnableLoginByWAM $false
131+
```

docs/upgrade-to-v2.md

+37-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ In v2, we've changed `-AccessToken` from `String` to `SecureString` type. This c
6464

6565
We've dropped support for `-ForceRefresh` on `Connect-MgGraph` command. `-ForceRefresh` is no longer support by the auth token credentials used in v2. Customers should instead use `Disconnect-MgGraph` to sign out of current context then call `Connect-MgGraph` to get a new access token.
6666

67+
### Renamed `DeviceManagement.Enrolment` module to `DeviceManagement.Enrollment`
68+
69+
`DeviceManagement.Enrolment` module has been renamed to `DeviceManagement.Enrollment` to align with the API.
70+
71+
### Directory Role and Entitlement Management Commands
72+
73+
Directory role and entitlement management commands that were in `DeviceManagement.Enrollment` module have been moved to `Identity.Governance` to align with the [API reference](https://learn.microsoft.com/graph/api/resources/directoryrole?view=graph-rest-1.0).
74+
6775
## New Features and Improvements
6876

6977
The following new features and improvements have been added to the module in v2.
@@ -124,9 +132,37 @@ Connect-MgGraph -EnvironmentVariable
124132

125133
### Service Modules
126134

135+
#### Count Commands (`/$count`)
136+
137+
We've added dedicated count commands in v2 for supported resources. In v2, you can now get a [count of users in your tenant](https://learn.microsoft.com/graph/api/user-list?view=graph-rest-1.0&tabs=http#example-3-get-only-a-count-of-users) using:
138+
139+
``` powershell
140+
$UsersCount = Get-MgUserCount -ConsistencyLevel Eventual
141+
```
142+
143+
See [advanced query capabilities on Azure AD objects](https://learn.microsoft.com/graph/aad-advanced-queries) for more details.
144+
145+
#### OData Cast Support
146+
147+
V2 adds OData cast commands via `*-Mg*As<CAST-Type>` syntax when supported by the API. With OData cast support, customers can now access properties on specialized types rather than going through AdditionalProperties for supported APIs. For example, one can use `Get-MgGroupMemberAsUser` to [list group members that are users](https://learn.microsoft.com/graph/api/group-list-members?view=graph-rest-1.0&tabs=http):
148+
149+
```powershell
150+
$Users = Get-MgGroupMemberAsUser -GroupId "GROUP_ID"
151+
```
152+
153+
> In the example above, the cast type can also be `ServicePrincipal`, `Application`, `Device`, `Group`, and more as supported by the API.
154+
155+
#### Improved Service Error Reporting
156+
157+
We've updated how service errors are written to the error stream to help with debugging API related errors. In v2, when a service error occurs, the SDK will now write message, HTTP status code, error code, request-id, date, and other useful headers to the error stream.
158+
159+
![image](https://github.com/microsoftgraph/msgraph-sdk-powershell/assets/7061532/45ab9783-12ee-4666-b6ee-c29bfbff6827)
160+
161+
See [Microsoft Graph API error response](https://learn.microsoft.com/graph/errors) for more details.
162+
127163
#### HTTP/2 support
128164

129-
v2 adds [HTTP/2](https://httpwg.org/specs/rfc7540.html) support for supported API endpoints. The module will gracefully fallback to HTTP/1.1 when HTTP/2 is not supported by the API. HTTP/2 improves performance by adding support for; multiplexing, header compression, and server push.
165+
V2 adds [HTTP/2](https://httpwg.org/specs/rfc7540.html) support for supported API endpoints. The module will gracefully fallback to HTTP/1.1 when HTTP/2 is not supported by the API. HTTP/2 improves performance by adding support for; multiplexing, header compression, and server push.
130166

131167
#### Success status code range support
132168

0 commit comments

Comments
 (0)