PowerShell SDK for automating the Microsoft Graph

Minimum PowerShell version


Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name autographps-sdk -RequiredVersion 0.12.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More


Adam Edwards


(c) 2019 Adam Edwards.

Package Details



MSGraph Graph AADGraph Azure MicrosoftGraph Microsoft-Graph MS-Graph AAD-Graph REST CRUD GraphAPI poshgraph poshgraph-sdk autograph Windows Linux MacOS


Connect-Graph Disconnect-Graph Find-GraphLocalCertificate Get-GraphApplication Get-GraphApplicationCertificate Get-GraphApplicationConsent Get-GraphApplicationServicePrincipal Get-GraphConnectionInfo Get-GraphError Get-GraphItem Get-GraphToken Invoke-GraphRequest New-GraphApplication New-GraphApplicationCertificate New-GraphConnection New-GraphLocalCertificate Register-GraphApplication Remove-GraphApplication Remove-GraphApplicationCertificate Remove-GraphApplicationConsent Remove-GraphItem Set-GraphApplicationConsent Set-GraphConnectionStatus Test-Graph Unregister-GraphApplication


Core Desktop


Release Notes

# AutoGraphPS-SDK 0.12.0 Release Notes

This release fixes defects introduced by the previous `0.11.1` release and includes some minor feature updates.

## New dependencies

## Breaking changes

## New features

* Added the `ReplyUrl` alias to the `AppRedirectUri` parameter of `Get-GraphToken`, `Connect-Graph` and `New-GraphConnection`
* `Get-GraphConnectionInfo` now includes a connection id guid property in its output to identify each unique connection

## Fixed defects

* `Test-Graph` command regression prevented targeting clouds other than `Public`
* `Get-GraphToken`, `Connect-Graph` and `New-GraphConnection` regressions caused certain parameter sets to require all parameters
* Fix race condition with `Connect-Graph` due to MSAL changes with integrated token cache: `Connect-Graph` created
 a new token, which was immediately invalidated, requiring a reconnect when used with a command.
* Fix error output from `Get-GraphToken` due to missing `GraphResourceUri` parameter, which also blocked alternate resource uri functionality

### Miscellaneous implementation notes

The most involved fix was to address a defect introduced when the `MSAL` library version was updated to `4.4.0`. Prior to this release, token caches were maintained independently from the `PublicClientApplication` or `ConfidentialClientApplication` authentication context.

With `MSAL` `4.4.0`, token caches were part of the authentication context. When `4.4.0` was integrated into `AutoGraphPS-SDK`, this change was accounted for, but there was still an assumption that the authentication context could be shared across the `AutoGraphPS-SDK` notion of `Connection` without the cache being affected by the sharing. Since cache had become part of the auth context, sharing the auth context as `AutoGraphPS-SDK` had always done for a given connection meant sharing caches; this introduced race conditions where a token could be added to a cache only to have it immediately removed by an operation that was assumed to be independent of that cache but wasn't. The result was that users would someitmes be requested to sign-in again immediately after a sign-in prompted by `Connect-Graph` or any command that affected connection management.

The fix was to ensure each connection used a separate authentication context by associating each auth context with a connection in a store of auth contexts. A better fix may be to remove the store of auth contexts altogether, and make the auth context part of the connection itself, or at least simplify the lookup logic to use only the connection id.


Version History

Version Downloads Last updated
0.30.0 106 2/19/2023
0.29.0 721 12/30/2021
0.28.0 553 10/12/2021
0.27.0 549 6/13/2021
0.26.1 463 5/5/2021
0.26.0 432 5/4/2021
0.25.0 452 2/27/2021
0.24.0 584 9/26/2020
0.23.0 388 9/26/2020
0.22.0 434 9/8/2020
0.21.1 589 6/20/2020
0.21.0 478 5/24/2020
0.20.0 786 4/19/2020
0.19.0 618 4/12/2020
0.18.0 1,159 2/8/2020
0.17.0 619 1/29/2020
0.16.0 713 11/6/2019
0.15.0 447 10/24/2019
0.14.0 411 10/23/2019
0.13.0 420 10/16/2019
0.12.0 (current version) 415 10/7/2019
0.11.1 483 9/23/2019
0.11.0 395 9/20/2019
0.10.0 590 3/18/2019
0.9.0 626 2/3/2019
0.8.1 411 1/19/2019
0.8.0 409 1/13/2019
0.7.1 417 1/8/2019
0.7.0 401 1/8/2019
0.6.2 407 1/6/2019
0.6.1 404 1/5/2019
0.6.0 407 1/2/2019
0.5.1 452 10/30/2018
0.5.0 452 9/30/2018
0.4.0 426 9/15/2018
Show less