You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Get-MgOauth2PermissionGrant does not properly return a count of objects. This is because $count requires a consistencyLevel=eventual header, but the command does not include consistency level as an available parameter. Note that this also affects get-mgoauth2permissiongrantcount for the same reason.
Option 1 returns no error, Option 2 returns an error:
Get-MgOauth2PermissionGrantCount_Get: Raw count (/$count) is not supported because the 'ConsistencyLevel:eventual' header is missing. Refer to https://aka.ms/graph-docs/advanced-queries for more information
Following the syntax of other commands, Get-MgOauth2PermissionGrant -CountVariable Foo -ConsistencyLevel eventual returns:
Get-MgOauth2PermissionGrant: A parameter cannot be found that matches parameter name 'ConsistencyLevel'.
Expected behavior
$Foo is populated with the count of Oauth2PermissionGrant Objects
Run the problematic command with -Debug and paste the resulting debug stream below.
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.
Module Version
Please run Get-Module Microsoft.Graph* after cmdlet execution and paste the output below.
If a module cannot be installed or imported, please run Get-Module -ListAvailable and paste the output.
Please run $PSVersionTable and paste the output below. If running the Docker container image, indicate the tag of the image used and the version of Docker engine.
PS C:\Users\erhall> $psversiontable
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
erhallMSFT
changed the title
Count fails on Get-MgOauth2PermissionGrant due to lack of consistencyLevel header option
$Count fails on Get-MgOauth2PermissionGrant due to lack of consistencyLevel header option
Jan 26, 2024
Hi @erhallMSFT with the current version(2.15.0), one is able to provide additional headers via the -Headers parameter. That is Get-MgOauth2PermissionGrantCount -Headers @{ 'ConsistencyLevel' = 'eventual' }. However, for this case it returns a different error stating that the query option $count is not supported. I am also unable to get the related api reference doc here.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Describe the bug
Get-MgOauth2PermissionGrant does not properly return a count of objects. This is because $count requires a consistencyLevel=eventual header, but the command does not include consistency level as an available parameter. Note that this also affects get-mgoauth2permissiongrantcount for the same reason.
To Reproduce
Steps to reproduce the behavior:
Get-MgOauth2PermissionGrant -CountVariable Foo
Get-MgOauth2PermissionGrantCount
Following the syntax of other commands,
Get-MgOauth2PermissionGrant -CountVariable Foo -ConsistencyLevel eventual
returns:Expected behavior
Debug Output
Module Version
Environment Data
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: