-
Notifications
You must be signed in to change notification settings - Fork 192
Allow caller to Specify desired OutputType #499
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
Conversation
Add "-Json" to return unprocess Json String Add "-Raw -OriginalRequestClone "requestClone" " to store a clone of the original request in a variable, including its content.
I think you need to simplify the variables that are used here, and fit them more into existing PowerShell paradigms. For example, instead of:
Why not provide an Also, for the # Get some services, output them to the console, and store them in $myServices
gsv -name wuauserv,bits -ov myServices
# Show the services that were stored
$myServices
# Get some more services, and _add_ them to the myServices variable (note the "+" prefix)
gsv -name k* -ov +myServices
# Show the updated services collection
$myServices This is the model that should be followed for requesting the HTTP request. If you were to apply this to the Graph cmdlets, the command might look like this: # Get users, output them, and capture the HTTP request
Get-MgUser -HttpRequestVariable httpRequest
# Look at the request
$httpRequest In this scenario, you are not dealing with data streams, so I don't think there is a lot of value in supporting the "+" prefix to add another request to an existing variable, other than to maintain consistency with the model that is already in place for capturing content in variables, so it's up to you whether or not you want to add that. I think these two sets of changes would make for a much better experience for PowerShell scripters that is easier to learn and use. |
src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs
Outdated
Show resolved
Hide resolved
…as PSObject, HashTable, Json or full Http Response.
…ftgraph/msgraph-sdk-powershell into features/IGRImprovements
Remove ternary operation due to implicit convertion of Hashtable to PSObject.
@finsharp do we have some limitation on the azure machines we need to look at. The errors for the integrated build seem to be indicating that. |
src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs
Outdated
Show resolved
Hide resolved
… tests. Upload test and code coverage results. Add tests for v1.0 and beta IGR.
src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs
Outdated
Show resolved
Hide resolved
src/Authentication/Authentication/test/Authentication.Tests.ps1
Outdated
Show resolved
Hide resolved
Add tests for Non-Json responses. Handle Debug correctly.
src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj
Outdated
Show resolved
Hide resolved
Throw error correctly.
Add



-OutputType [HashTable | PSObject | HttpResponseMessage | Json]
parameter to enable caller decide preferred format.HashTable
is the default.PSObject for a Single Entity
PSObject for a collection
HttpResponseMessage
Resolves #480 #479 #454