# microsoftgraph/msgraph-sdk-powershell architecture

> Architecture diagram of the GitHub repository microsoftgraph/msgraph-sdk-powershell, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoftgraph/msgraph-sdk-powershell
- Repository: https://github.com/microsoftgraph/msgraph-sdk-powershell

## Overview

Microsoft Graph PowerShell is an SDK for invoking Microsoft Graph resources through PowerShell commands, with authentication, request configuration, and scenario-specific modules for v1.0 and beta. The principal workflow is a user running a resource command that wraps a Graph API operation. Authentication and HTTP-client internals are represented where source excerpts or the SOURCE INDEX support their relationships. The sampled material does not establish how generated scenario commands connect to the shared client, so that link is documented but unverified.

Main entry points: [`src/Authentication/Authentication.Core/Common/GraphSession.cs`](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Common/GraphSession.cs) (Graph session), [`src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs`](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs) (HTTP client factory), [`src`](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src) (Resource commands), [`src/Applications/beta/custom`](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Applications/beta/custom) (Applications resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commands["PowerShell commands"]
  node_resource_cmds["Resource commands"]
  node_auth_cmdlets["Auth commands"]
end

subgraph group_auth["Authentication and session"]
  node_session["Graph session<br/>[GraphSession.cs]"]
  node_auth_context["Auth context<br/>[AuthContext.cs]"]
  node_auth_helpers["Auth provider setup"]
  node_env["Graph environments"]
  node_settings["Graph settings<br/>[GraphSettings.cs]"]
  node_store[("Disk data store<br/>[DiskDataStore.cs]")]
end

subgraph group_http["HTTP pipeline"]
  node_client_factory["HTTP client factory"]
  node_auth_handler["Authentication handler"]
  node_odata_handler["OData query handler"]
end

subgraph group_resources["Graph resources"]
  node_applications["Applications resources"]
  node_calendar["Calendar resources"]
  node_files["Files resources"]
  node_groups["Groups resources"]
  node_teams["Teams extensions"]
end

node_user(("PowerShell user"))
node_ps(("PowerShell"))
node_graph_api{{"Microsoft Graph API"}}

node_user -->|"runs commands"| node_ps
node_ps -->|"invokes wrappers"| node_resource_cmds
node_resource_cmds -->|"calls Graph"| node_graph_api
node_ps -.->|"configures access"| node_auth_cmdlets
node_client_factory -->|"creates provider"| node_auth_helpers
node_client_factory -->|"registers handler"| node_auth_handler
node_session -->|"references context"| node_auth_context
node_session -->|"references environment"| node_env
node_session -->|"references store"| node_store
node_applications -->|"wraps API operations"| node_graph_api
node_calendar -->|"wraps API operations"| node_graph_api
node_files -->|"wraps API operations"| node_graph_api
node_groups -->|"wraps API operations"| node_graph_api
node_teams -->|"wraps API operations"| node_graph_api

click node_resource_cmds "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src"
click node_auth_cmdlets "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Authentication/Authentication/Cmdlets"
click node_session "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Common/GraphSession.cs"
click node_auth_context "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Models/AuthContext.cs"
click node_auth_helpers "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs"
click node_env "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Models/GraphEnvironment.cs"
click node_settings "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Common/GraphSettings.cs"
click node_store "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Common/DiskDataStore.cs"
click node_client_factory "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs"
click node_auth_handler "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Http/AuthenticationHandler.cs"
click node_odata_handler "https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Handlers/ODataQueryOptionsHandler.cs"
click node_applications "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Applications/beta/custom"
click node_calendar "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Calendar/beta/custom"
click node_files "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Files/beta/custom"
click node_groups "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Groups/beta/custom"
click node_teams "https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Teams/beta/custom"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_resource_cmds,node_auth_cmdlets,node_user toneBlue
class node_session,node_auth_context,node_auth_helpers,node_env,node_settings,node_store toneAmber
class node_client_factory,node_auth_handler,node_odata_handler,node_graph_api toneMint
class node_applications,node_calendar,node_files,node_groups,node_teams toneRose
class node_ps toneIndigo
```

## Components

### PowerShell commands

- [Resource commands](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src): `src`
- [Auth commands](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Authentication/Authentication/Cmdlets): `src/Authentication/Authentication/Cmdlets`

### Authentication and session

- [Graph session](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Common/GraphSession.cs): `src/Authentication/Authentication.Core/Common/GraphSession.cs`
- [Auth context](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Models/AuthContext.cs): `src/Authentication/Authentication/Models/AuthContext.cs`
- [Auth provider setup](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs): `src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs`
- [Graph environments](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Models/GraphEnvironment.cs): `src/Authentication/Authentication/Models/GraphEnvironment.cs`
- [Graph settings](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Common/GraphSettings.cs): `src/Authentication/Authentication/Common/GraphSettings.cs`
- [Disk data store](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Common/DiskDataStore.cs): `src/Authentication/Authentication/Common/DiskDataStore.cs`

### HTTP pipeline

- [HTTP client factory](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs): `src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs`
- [Authentication handler](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication.Core/Http/AuthenticationHandler.cs): `src/Authentication/Authentication.Core/Http/AuthenticationHandler.cs`
- [OData query handler](https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/main/src/Authentication/Authentication/Handlers/ODataQueryOptionsHandler.cs): `src/Authentication/Authentication/Handlers/ODataQueryOptionsHandler.cs`

### Graph resources

- [Applications resources](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Applications/beta/custom): `src/Applications/beta/custom`
- [Calendar resources](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Calendar/beta/custom): `src/Calendar/beta/custom`
- [Files resources](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Files/beta/custom): `src/Files/beta/custom`
- [Groups resources](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Groups/beta/custom): `src/Groups/beta/custom`
- [Teams extensions](https://github.com/microsoftgraph/msgraph-sdk-powershell/tree/main/src/Teams/beta/custom): `src/Teams/beta/custom`

### Other components

- **PowerShell user**
- **PowerShell**
- **Microsoft Graph API**

## Connections

- PowerShell user → PowerShell: runs commands (evidence: `README.md`)
- PowerShell → Resource commands: invokes wrappers (evidence: `README.md`)
- Resource commands → Microsoft Graph API: calls Graph (evidence: `README.md`)
- PowerShell → Auth commands: configures access
- HTTP client factory → Auth provider setup: creates provider (evidence: `src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs`)
- HTTP client factory → Authentication handler: registers handler (evidence: `src/Authentication/Authentication.Core/Http/GraphHttpClientFactory.cs`)
- Graph session → Auth context: references context (evidence: `src/Authentication/Authentication.Core/Common/GraphSession.cs`)
- Graph session → Graph environments: references environment (evidence: `src/Authentication/Authentication.Core/Common/GraphSession.cs`)
- Graph session → Disk data store: references store (evidence: `src/Authentication/Authentication.Core/Common/GraphSession.cs`)
- Applications resources → Microsoft Graph API: wraps API operations (evidence: `README.md`)
- Calendar resources → Microsoft Graph API: wraps API operations (evidence: `README.md`)
- Files resources → Microsoft Graph API: wraps API operations (evidence: `README.md`)
- Groups resources → Microsoft Graph API: wraps API operations (evidence: `README.md`)
- Teams extensions → Microsoft Graph API: wraps API operations (evidence: `README.md`)
