Provides Connectivity and access to Microsoft Graph API

Minimum PowerShell version


Installation Options

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

Install-Module -Name psmsgraph -RequiredVersion

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


Mark Kraus


(c) 2017. All rights reserved.



Graph GraphAPI MSGraph MSGraphAPI PSMSGraph PSMSGraphAPI MicrosoftGraph MicrosoftGraphAPI API OAuth REST CRUD


Add-AADAppRoleAssignment Export-GraphApplication Export-GraphOauthAccessToken Get-AADGroupByDisplayName Get-AADGroupByID Get-AADGroupMember Get-AADServicePrincipalAppRoleAssignedTo Get-AADServicePrinicpalbyDisplayName Get-AADServicePrinicpalbyId Get-AADUserAll Get-AADUserAppRoleAssignment Get-AADUserByID Get-AADUserByUserPrincipalName Get-GraphOauthAccessToken Get-GraphOauthAuthorizationCode Import-GraphApplication Import-GraphOauthAccessToken Invoke-GraphRequest New-GraphApplication New-GraphOauthAccessToken Remove-AADAppRoleAssignment Update-GraphOauthAccessToken


This module has no dependencies.

Release Notes

# Version (2017-04-22)
## Functions
### Get-GraphOauthAccessToken
* Revised Invoke-WebRequest error handling. Now uses ```MSGraphAPI.Oauth.Exception``` to handle formating
* Simplified error handling for JSON parsing
* Revamped credential object creation for readbility.
* Clean up debug code

## Types
### MSGraphAPI.Oauth.Exception
* Added the ```MSGraphAPI.Oauth.Exception``` type to handle OAuth related ```Invoke-Webrequest``` Exceptions
* New ScriptMethod JSONResponse converts the response stream from the ```Invoke-WebRequest``` exception from JSON to PSObject

## Test
### Get-GraphOauthAccessToken.Unit.Tests.ps1
* Added missing code coverage for ```Invoke-webRequest``` error handling
* Add missing code coverage for JSON parsing error handling
* Now at 100% code coverage for ```Get-GraphOauthAccessToken```!

## Built Toolds
### psake.ps1
* Adjust recommit logic in PostDeploy task
* Added ```!forcrecommit``` to override default ignores if needed
* Added ```devlop``` to ignored branch for recommits as constant work in the develop branch leads to staging issues.
* Added comment based help file header.

## Documentation
### Get-GraphOauthAccessToken
* Modifyed Description to something useful
* adjusted formating on ```Resource``` parameter
* Added ```Get-GraphOauthAuthorizationCode``` to Notes
* Added ```Get-GraphOauthAuthorizationCode``` to Links

Version History

Version Downloads Last updated 4,304 5/26/2019 3,828 4/30/2017 (current version) 22 4/22/2017 18 4/15/2017 45 3/5/2017 10 3/3/2017 14 3/1/2017 9 2/27/2017 9 2/26/2017 63 2/26/2017 12 2/25/2017