You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: microsoftgraph/docs-conceptual/installation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: "Learn how to install the Microsoft Graph PowerShell SDK with Power
5
5
author: msewaweru
6
6
manager: CelesteDG
7
7
ms.topic: how-to
8
-
ms.date: 03/05/2024
8
+
ms.date: 03/12/2025
9
9
ms.author: eunicewaweru
10
10
11
11
#customer intent: As a PowerShell user, I want to install the Microsoft Graph PowerShell SDK, so that I can use it to interact with Microsoft Graph and perform tasks using PowerShell.
@@ -38,7 +38,7 @@ The Microsoft Graph PowerShell SDK comes in two modules, Microsoft.Graph and Mic
38
38
Using the **Install-Module** cmdlet is the preferred installation method for the Microsoft Graph PowerShell modules.
39
39
40
40
> [!NOTE]
41
-
> Installing the main modules of the SDK, Microsoft.Graph and Microsoft.Graph.Beta, will install all 38 sub modules for each module. Consider only installing the necessary modules, including `Microsoft.Graph.Authentication` which is installed by default when you opt to install the sub modules individually. For a list of available Microsoft Graph modules, use `Find-Module Microsoft.Graph*`.
41
+
> Installing the main modules of the SDK, Microsoft.Graph or Microsoft.Graph.Beta, will install the over 47 sub modules for each module. Consider only installing the necessary modules, including `Microsoft.Graph.Authentication` which is installed by default when you opt to install the sub modules individually. For a list of available Microsoft Graph modules, use `Find-Module Microsoft.Graph*`.
42
42
> Only cmdlets for the installed modules will be available for use.
43
43
44
44
To install the v1 module of the SDK in PowerShell Core or Windows PowerShell, run the following command.
@@ -78,7 +78,7 @@ To verify the installed submodules and their versions, run:
78
78
Get-InstalledModule
79
79
```
80
80
81
-
The version in the output should match the latest version published on the PowerShell Gallery. Now you're ready to use the SDK.
81
+
The version in the output should match the latest version published on [the PowerShell Gallery](https://www.powershellgallery.com/packages/Microsoft.Graph). Now you're ready to use the SDK.
title: "Navigating the Microsoft Graph PowerShell SDK"
2
+
title: "Navigate the Microsoft Graph PowerShell SDK"
3
3
description: "The Microsoft Graph PowerShell SDK contains a large number of commands. Learn how to find the right command for what you want to achieve."
4
4
5
5
author: msewaweru
6
6
manager: CelesteDG
7
7
ms.topic: conceptual
8
-
ms.date: 03/05/2024
8
+
ms.date: 03/12/2025
9
9
ms.author: eunicewaweru
10
-
11
-
#customer intent: As a user new to the Microsoft Graph PowerShell SDK, I want to find the right command for a specific task, so that I can effectively use the SDK to interact with the Microsoft Graph API.
10
+
#customer intent: As a user new to the Microsoft Graph PowerShell SDK, I want to find the right command for a specific task, so that I can effectively use Microsoft Graph PowerShell to interact with the Microsoft Graph API.
12
11
---
13
12
14
-
# Navigating the Microsoft Graph PowerShell SDK
13
+
# Navigate the Microsoft Graph PowerShell SDK
15
14
16
15
The Microsoft Graph API is huge, and it's growing all the time. Therefore, the number of commands in the Microsoft Graph PowerShell SDK is also large. Finding the right command for what you want to achieve can be challenging, especially if you're not already familiar with Microsoft Graph. Let's look at some ways to help find a particular command.
The commands in the SDK are generated directly from the [REST API](/graph/api/overview?view=graph-rest-1.0&preserve-view=true), so the names are influenced by the API. You don't have to understand the details of the API to use the Microsoft Graph PowerShell SDK, but it helps to understand the naming convention.
21
+
Microsoft Graph PowerShell generates commands directly from the [Microsoft Graph API](/graph/api/overview), so the API influences their names. You don't have to understand the details of the API to use Microsoft Graph PowerShell, but it helps to understand the naming convention.
23
22
24
23
PowerShell commands are named using a verb-noun pair, such as `Get-Command` or `Update-List`. Let's start with the verb.
25
24
26
25
### Command verbs
27
26
28
-
For basic REST operations, the verb is determined by the HTTP method used for the API.
27
+
For basic REST operations, the HTTP method determines the verb used for the API.
29
28
30
-
| HTTP method| Command verb| Example |
31
-
|-------------|--------------|---|
32
-
| GET | Get |`Get-MgUser`[API reference](/graph/api/user-get?view=graph-rest-1.0&preserve-view=true)|
33
-
| POST | New |`New-MgUserMessage`[API reference](/graph/api/user-post-messages?view=graph-rest-1.0&preserve-view=true)|
34
-
| PUT | New |`New-MgTeam`[API reference](/graph/api/team-put-teams?view=graph-rest-1.0&preserve-view=true)|
For functions and actions, it's a little more complicated. APIs in Microsoft Graph that are implemented as OData functions or actions are typically named with at least a verb. The corresponding command's verb is based on the verb in the function or action name. However, command verbs in PowerShell have to conform to specific [naming rules](/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands), which can result in nonintuitive name-to-command mappings.
39
38
40
-
Let's look at some examples. The [getSchedule](/graph/api/calendar-getschedule?view=graph-rest-1.0&preserve-view=true) API uses `get`, and `Get` is an approved PowerShell verb, so its command is `Get-MgUserCalendarSchedule`. The [cancel](/graph/api/event-cancel?view=graph-rest-beta&preserve-view=true) API on an event on the other hand, uses a nonapproved verb `cancel`. The approved verb for canceling or discontinuing something is `Stop`, so the command is `Stop-MgUserEvent`. Finally, the [snoozeReminder](/graph/api/event-snoozereminder?view=graph-rest-1.0&preserve-view=true) API's verb, `snooze`, has no PowerShell-approved equivalent. For APIs like that, the SDK uses the verb `Invoke`, so that API's command is `Invoke-MgSnoozeUserEventReminder`.
39
+
Let's look at some examples. The [getSchedule](/graph/api/calendar-getschedule) API uses `get`, and `Get` is an approved PowerShell verb, so its command is `Get-MgUserCalendarSchedule`. The [cancel](/graph/api/event-cancel) API on an event on the other hand, uses a nonapproved verb `cancel`. The approved verb for canceling or discontinuing something is `Stop`, so the command is `Stop-MgUserEvent`. Finally, the [snoozeReminder](/graph/api/event-snoozereminder) API's verb, `snooze`, has no PowerShell-approved equivalent. For APIs like that, Microsoft Graph PowerShell uses the verb `Invoke`, so that API's command is `Invoke-MgSnoozeUserEventReminder`.
41
40
42
41
> [!NOTE]
43
-
> For Beta cmdlets add a **Beta** prefix before the resource. For example, the beta version of the Get-MgUser cmdlet is **Get-MgBetaUser**.
42
+
> For Beta cmdlets, add a **Beta** prefix before the resource. For example, the beta version of the Get-MgUser cmdlet is **Get-MgBetaUser**.
44
43
45
44
### Command nouns
46
45
47
-
By now you may have noticed that all nouns in the SDK's commands start with `Mg`. This prefix helps to avoid naming conflicts with other PowerShell modules. With that in mind, it should make sense that a command like `Get-MgUser`is used to get a user. Following PowerShell convention, even though the noun is singular, those same commands can return multiple results if no specific instance is requested.
46
+
By now, you might notice that all nouns in Microsoft Graph PowerShell commands start with `Mg`. This prefix helps avoid naming conflicts with other PowerShell modules. With that in mind, a command like `Get-MgUser`gets a user. Following PowerShell convention, even though the noun is singular, these commands return multiple results if no specific instance is requested.
48
47
49
-
But what about commands like `Get-MgUserMessage` or `Get-MgUserMailFolderMessage`? Both of these commands get a [message](/graph/api/resources/message?view=graph-rest-1.0&preserve-view=true) object, so why not `Get-MgMessage`? The answer comes from the [get message API](/graph/api/message-get?view=graph-rest-1.0&preserve-view=true).
48
+
But what about commands like `Get-MgUserMessage` or `Get-MgUserMailFolderMessage`? Both of these commands get a [message](/graph/api/resources/message) object, so why not `Get-MgMessage`? The answer comes from the [get message API](/graph/api/message-get).
50
49
51
50
Look at the HTTP requests for this API. If you ignore the requests with `/me` in the URL, there are two other ways to call this API.
52
51
@@ -63,20 +62,20 @@ Use [Find-MgGraphCommand](find-mg-graph-command.md) to discover which API path a
63
62
64
63
### Listing parameters
65
64
66
-
After you've found the right command, you can examine all the available parameters by using the `Get-Help` command. For example, the following command lists all the available parameters for the `Get-MgUser` command.
65
+
After you find the right command, you examine all the available parameters using the `Get-Help` command. For example, the following command lists all the available parameters for the `Get-MgUser` command.
67
66
68
67
```powershell
69
68
Get-Help Get-MgUser -Detailed
70
69
```
71
70
72
71
## Finding available commands
73
72
74
-
Sometimes just knowing the naming conventions isn't enough to guess the right command. In this case, you can use the `Get-Command` command to search the available commands in the SDK. For example, if you're looking for commands related to Microsoft Teams, you can run the following command.
73
+
Sometimes just knowing the naming conventions isn't enough to guess the right command. In this case, you can use the `Get-Command` command to search the available commands in Microsoft Graph PowerShell. For example, if you're looking for commands related to Microsoft Teams, you can run the following command.
75
74
76
75
```powershell
77
76
Get-Command -Module Microsoft.Graph* *team*
78
77
```
79
78
80
79
## Next steps
81
80
82
-
- Discover Microsoft Graph PowerShell cmdlets [Using Find-MgGraphCommand cmdlet](find-mg-graph-command.md).
81
+
- Discover Microsoft Graph PowerShell cmdlets [using Find-MgGraphCommand cmdlet](find-mg-graph-command.md).
0 commit comments