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.22.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) 2020 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


Clear-GraphLog Connect-Graph Disconnect-Graph Find-GraphLocalCertificate Format-GraphLog Get-GraphApplication Get-GraphApplicationCertificate Get-GraphApplicationConsent Get-GraphApplicationServicePrincipal Get-GraphConnectionInfo Get-GraphError Get-GraphResource Get-GraphLog Get-GraphLogOption 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 Set-GraphLogOption Test-Graph Unregister-GraphApplication


Core Desktop


Release Notes

## AutoGraphPS-SDK 0.22.0 Release Notes

This release adds helper libraries for interpreting OData protocol response metadata, simplifies result paging capabilities, adds a detailed Graph response output format for applications building complex scenarios that require protocol awareness, and adds preview support for delta query.

### New dependencies


### Breaking changes

* The `IncludeFullResponse` parameter is no longer supported by the `Invoke-GraphRequest` command. It has been superseded by the `AsResponseDetail` parameter added in this release.
* Applications created by New-GraphApplication no longer include 'http://localhost' and 'urn:ietf:wg:oauth:2.0:oob' by default. The only default URI specified for these application is ''.

### New features

* `Invoke-GraphRequest` has several new parameters to support delta query and improved control over result pagin:
 * `AsResponseDetail`: when specified, the output of the command rather than directly returning the deserialized objects from the Graph response instead returns a structure that includes a `Content` field that contains those objects. The other fields of the structure include additional details about the response, including conditionally populated fields such as `DeltaUri` and `DeltaToken` returned from delta query responses. The `Responses` field contains all of the detailed protocol responses from the graph that were issued as the command paged through result sets that required multiple requests to process.
 * `Delta`: when this is specified, the command issues a delta query to Graph, i.e. a query that in addition to returning the results specified in the query also returns additional metadata in the form of a "delta URI" or "delta token" that can be used in subsequent requests to return only the information that has changed since the original query. When this parameter is specified, the results are returned in the format used when `AsResponseDetail` is specified.
 * `DeltaToken`: This parameter provides a way to request only the incremental changes that would be returned compared to a previous request issued by this command using the Delta parameter.
 * `NoPaging`: This disables the default behavior of the command that issues multiple requests to Graph until all results for the initial request have been retrieved. When this command is specified, the results are returned using the `AsResponseDetail` format so that the caller has the additional information beyond the request results necessary to retrieve the additional results if desired.
 * `PageSizePreference`: directs the command to issues requests that instruct the Graph API to return a specific maximum number of items in each page of results. This parameter will only take effect if Graph honors it for the particular request.
 * `ResponseContext` class: This class parses the `ODataContext` property, an [OData Context URL]( to return information about the type of the response and the URI used to make the request.
 * New methods in `GraphUtilities`:
   * `GetAbstractUriFromResponseObject` returns a close approximation of a URI that can be used to make a request for that response.
   * `GetOptionalTypeFromResponseObject` returns the parsed type from `@odata.type` for a given object if it is present
* AAD Application commands such as New-GraphApplication, Get-GraphApplication, Set-GraphApplicationConsent, etc., have been updated to use Graph API version v1.0 instead of beta since all application functionality is now present in v1.0.

### Fixed defects

* V2 public client authentication fails with mismatch reply URL when using a non-default app id unless localhost is configured as a reply url. The only workaround was to add localhost as a reply url to the app because no reply URL was specified by AutoGraphPS to the MSAL library when making the request. From an MSAL (and possibly from the protocol) standpoint, this is the equivalent of specifying no reply url. The fix is to specify whatever reply URL is configured in the local connection; by default, the app now uses '', which is now the default reply URL for applications created by New-GraphApplication.
* Get-GraphLog and related commands did not function correctly on PowerShell 7 -- error responses were logged with incomplete fields including an invalid http status code of 0. This was due to the underlying http client type being different on PowerShell 7 vs. PowerShell 5, and the methods and properties were different for this class, resulting in errors when trying to read data from the response. This seemed to only be an issue for error responses. The fix ensures that the type differences are accounted for on the different platforms and restores the error logging.
* Fixed an error where apps created by New-GraphApplication were registered such that device code authentication flow could not be used to sign-in with the apps. They were missing the fallbackPublicClient property for the app, which is apparently required for that flow to work. This is now fixed, and this restores device code flow login for these apps, which is critical for PowerShell 7 and later since they do not support the web browser controls used to sign in on PowerShell 5.


Version History

Version Downloads Last updated
0.30.0 108 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 (current version) 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 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