Tests/Test-Consent.ps1

Remove-Module AadSupport
Import-Module AadSupport

Connect-AadSupport

Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "TEST Set-AadConsent : Admin Consent for OAuth2PermissionGrants" -ForegroundColor Yellow
Set-AadConsent -Id 'test native app' -ResourceId 'https://graph.windows.net' -Scopes 'User.ReadWrite.All'
Set-AadConsent -Id 'test native app' -ResourceId 'https://graph.windows.net' -Scopes 'User.Read'

Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "TEST Set-AadConsent : Add User Consent for OAuth2PermissionGrants" -ForegroundColor Yellow
Set-AadConsent -Id 'test native app' -ResourceId 'https://graph.windows.net' -Scopes 'User.ReadWrite.All' -UserId admin@williamfiddes.onmicrosoft.com
Set-AadConsent -Id 'test native app' -ResourceId 'https://graph.windows.net' -Scopes 'User.Read' -UserId admin@williamfiddes.onmicrosoft.com

Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "TEST Set-AadConsent : Admin Consent for Application Permissions" -ForegroundColor Yellow
Set-AadConsent -Id 'custom web app' -ResourceId 'https://graph.microsoft.com' -Roles 'User.ReadWrite.All'