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
I'm considering this an issue (not a feature request) since I'd expect others to also file this as a bug. I'm all for using generics for type safety, but...come on. I shouldn't have to cast a whole new dictionary on a separate line just to use this argument.
Expected behavior
The -AdditionalHeaders argument of Invoke-PnPGraphMethod should accept a hashtable the sake of simplicity and readability.
Actual behavior
When using a hashtable in the -AdditionalHeaders argument of Invoke-PnPGraphMethod, I receive the error message:
Cannot bind parameter 'AdditionalHeaders'. Cannot convert the "System.Collections.Hashtable" value of type "System.Collections.Hashtable" to type "System.Collections.Generic.IDictionary`2[System.String,System.String]".
gautamdsheth
changed the title
[BUG] Invoke-PnPGraphMethod -AdditionalHeaders does not accept a hashtable
[Change Request] Invoke-PnPGraphMethod -AdditionalHeaders does not accept a hashtable
Jun 26, 2024
Reporting an Issue or Missing Feature
I'm considering this an issue (not a feature request) since I'd expect others to also file this as a bug. I'm all for using generics for type safety, but...come on. I shouldn't have to cast a whole new dictionary on a separate line just to use this argument.
Expected behavior
The
-AdditionalHeaders
argument ofInvoke-PnPGraphMethod
should accept a hashtable the sake of simplicity and readability.Actual behavior
When using a hashtable in the
-AdditionalHeaders
argument ofInvoke-PnPGraphMethod
, I receive the error message:The workaround is:
Steps to reproduce behavior
Sample command (Connected to PnP with
-Interactive
or an app registration with User.Read.All):What is the version of the Cmdlet module you are running?
2.4.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: