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
{{ message }}
Repository navigation
[FeatureRequest] New Command Get-GraphClient that returns the httpclient used by the module. #127
The current Autorest-based module has several limitations. Please make it easy to work around those limitations by exposing the httpclient used by the module so that we can invoke additional custom queries.
Alternatively, Add a Invoke-Graph -URI that runs a request using the existing Httpclient and returns the raw output.
This way the graph API token doesn't have to be directly exposed (sure you can still fetch it from the cookies property of the httpclient, but it's not stored securely in memory cross-platform anyways)
Use case: I want to download files with /content, there's no option to do that, and if I try to modify an existing client with an HTTPRequesthandler, the downloaded file is not in json format so the command still fails.
Having some kind of Invoke-GraphRequest seems like a good idea. It also is a good workaround for us being able to get at non-JSON responses. /cc Peter Ombwa (@peombwa)
Reacted by Peter Ombwa, John Milner, Mike Campbell and Kirk Munro
Justin Grote (@JustinGrote) I see you closed this issue - despite finding a workaround using the extension method, as per Darrel (@darrelmiller)'s comment I still feel the module would benefit from a Invoke-GraphRequest type of Cmdlet? Should this stay open for that purpose?
Brett Hoggins (@BHoggs) I'd be fine with it if it's within the scope of the team, to use, so we can note that the workaround is sufficient but having it as a cmdlet would be better.
Activity
darrelmiller commentedon Mar 11, 2020
Having some kind of Invoke-GraphRequest seems like a good idea. It also is a good workaround for us being able to get at non-JSON responses. /cc Peter Ombwa (@peombwa)
jmiller76 commentedon Apr 1, 2020
Justin Grote (@JustinGrote) does
$Client = [Microsoft.Graph.PowerShell.Authentication.Helpers.HttpHelpers]::GetGraphHttpClient((Get-MgContext))
Do what you need?
JustinGrote commentedon Apr 1, 2020
Yes it does! Thanks for hunting down that extension method for me, I hadn't upgraded to 0.2.0 yet.
I put this function in my profile for convenience:
BHoggs commentedon Apr 15, 2020
Justin Grote (@JustinGrote) I see you closed this issue - despite finding a workaround using the extension method, as per Darrel (@darrelmiller)'s comment I still feel the module would benefit from a Invoke-GraphRequest type of Cmdlet? Should this stay open for that purpose?
JustinGrote commentedon Apr 15, 2020
Brett Hoggins (@BHoggs) I'd be fine with it if it's within the scope of the team, to use, so we can note that the workaround is sufficient but having it as a cmdlet would be better.
darrelmiller commentedon May 7, 2020
finsharp We should create a wrapper cmdlet called Invoke-GraphRequest that allows arbitrary calls to the Graph with the token.