pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
684 stars 351 forks source link

[BUG] Invoke-PnPGraphMethod ignores ConsistencyLevelEventual parameter #4519

Closed reusto closed 2 weeks ago

reusto commented 2 weeks ago

Reporting an Issue or Missing Feature

Issue

Expected behavior

When using Invoke-PnPGraphMethod with parameter ConsistencyLevelEventual the header "ConsistencyLevel" should be set to "eventual" to perform graph REST API actions only supported with this header.

Actual behavior

When using Invoke-PnPGraphMethod with parameter ConsistencyLevelEventual the header is not set correctly unless the AdditionalHeaders parameter is also set and returns an error when the query requires this specific header.

Steps to reproduce behavior

Send a graph request that requires the ConsistencyLevel header to be set to eventual, e.g. users filtered by companyName property.

Returns "Unsupported or invalid query filter clause specified for property 'companyName' of resource 'User'."

Invoke-PnPGraphMethod -Url "/users?`$filter=companyName eq 'testCompany'&`$count=true" -ConsistencyLevelEventual;

Works without an error

Invoke-PnPGraphMethod -Url "/users?`$filter=companyName eq 'testCompany'&`$count=true" -ConsistencyLevelEventual -AdditionalHeaders @{};

What is the version of the Cmdlet module you are running?

2.12.0

Which operating system/environment are you running PnP PowerShell on?