-
Notifications
You must be signed in to change notification settings - Fork 192
[FeatureRequest] New Command Get-GraphClient that returns the httpclient used by the module. #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 @peombwa |
@JustinGrote does Do what you need? |
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: function Get-GraphClient ($context = (Get-MGContext)) {
[Microsoft.Graph.PowerShell.Authentication.Helpers.HttpHelpers]::GetGraphHttpClient($context)
} |
@JustinGrote I see you closed this issue - despite finding a workaround using the extension method, as per @darrelmiller's comment I still feel the module would benefit from a Invoke-GraphRequest type of Cmdlet? Should this stay open for that purpose? |
@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. |
@finsharp We should create a wrapper cmdlet called Invoke-GraphRequest that allows arbitrary calls to the Graph with the token. |
Uh oh!
There was an error while loading. Please reload this page.
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.
The text was updated successfully, but these errors were encountered: