# toasterlabs/m365inventory architecture

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

- Interactive diagram: https://gitdiagram.com/toasterlabs/m365inventory
- Repository: https://github.com/toasterlabs/m365inventory

## Overview

M365Inventory is a graphical PowerShell tool for inventorying Microsoft 365 tenants and Azure resources, with Graph-based usage reports as an additional capability. The documented workflow is user → GUI → inventory scripts → tenant and Azure inventory targets. The README also documents Graph API setup and required service modules. Source excerpts are limited to an otherwise empty secondary window, so implementation-level calls and wiring cannot be verified; the edges shown are supported by the README.

Main entry points: [`Resources/Scripts/Load-Main.ps1`](https://github.com/toasterlabs/m365inventory/blob/master/Resources/Scripts/Load-Main.ps1) (PowerShell scripts), [`Resources/Forms/MainWindow.xaml`](https://github.com/toasterlabs/m365inventory/blob/master/Resources/Forms/MainWindow.xaml) (Inventory GUI), [`Resources/Modules`](https://github.com/toasterlabs/m365inventory/tree/master/Resources/Modules) (Graph usage reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_gui["Inventory GUI<br/>[MainWindow.xaml]"]
end

subgraph group_inventory["Inventory workflow"]
  node_launcher["Startup script"]
  node_scripts["PowerShell scripts<br/>[Load-Main.ps1]"]
  node_module["Inventory module"]
  node_graphreports["Graph usage reports"]
end

subgraph group_integrations["Cloud integrations"]
  node_tenant[("Microsoft 365 tenant")]
  node_azure[("Azure resources")]
  node_graphapi["Microsoft Graph API"]
end

node_user(("Administrator"))

node_user -->|"uses"| node_gui
node_gui -->|"launches"| node_scripts
node_scripts -->|"inventories"| node_tenant
node_scripts -->|"inventories"| node_azure
node_graphreports -->|"retrieves reports"| node_graphapi

click node_gui "https://github.com/toasterlabs/m365inventory/blob/master/Resources/Forms/MainWindow.xaml"
click node_launcher "https://github.com/toasterlabs/m365inventory/blob/master/Start-Automaton.ps1"
click node_scripts "https://github.com/toasterlabs/m365inventory/blob/master/Resources/Scripts/Load-Main.ps1"
click node_module "https://github.com/toasterlabs/m365inventory/blob/master/Resources/Modules/M365InventoryAutomaton.psm1"
click node_graphreports "https://github.com/toasterlabs/m365inventory/tree/master/Resources/Modules"

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_gui toneBlue
class node_launcher,node_scripts,node_module,node_graphreports toneAmber
class node_tenant,node_azure,node_graphapi toneMint
class node_user toneIndigo
```

## Components

### Desktop interface

- [Inventory GUI](https://github.com/toasterlabs/m365inventory/blob/master/Resources/Forms/MainWindow.xaml): `Resources/Forms/MainWindow.xaml`

### Inventory workflow

- [Startup script](https://github.com/toasterlabs/m365inventory/blob/master/Start-Automaton.ps1): `Start-Automaton.ps1`
- [PowerShell scripts](https://github.com/toasterlabs/m365inventory/blob/master/Resources/Scripts/Load-Main.ps1): `Resources/Scripts/Load-Main.ps1`
- [Inventory module](https://github.com/toasterlabs/m365inventory/blob/master/Resources/Modules/M365InventoryAutomaton.psm1): `Resources/Modules/M365InventoryAutomaton.psm1`
- [Graph usage reports](https://github.com/toasterlabs/m365inventory/tree/master/Resources/Modules): `Resources/Modules`

### Cloud integrations

- **Microsoft 365 tenant**
- **Azure resources**
- **Microsoft Graph API**

### Other components

- **Administrator**

## Connections

- Administrator → Inventory GUI: uses (evidence: `README.md`)
- Inventory GUI → PowerShell scripts: launches (evidence: `README.md`)
- PowerShell scripts → Microsoft 365 tenant: inventories (evidence: `README.md`)
- PowerShell scripts → Azure resources: inventories (evidence: `README.md`)
- Graph usage reports → Microsoft Graph API: retrieves reports (evidence: `README.md`)
