Azure / Azure/autorest.powershell
[FeatureRequest] ParameterSet/parameter that returns `HttpRequestMessage` object without making a call
- Dominant language
- C#
- Stars
- 123
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
We are considering adding [OData batch request](https://docs.microsoft.com/en-us/graph/json-batching) support to our PowerShell SDK generated using AutoREST.PowerShell. To do this, we need to access the `HttpRequestMessage` object for each cmdlet that participates in the batch request without making a call to the service.
### Proposal
Add a `WithHttpRequestOutput` AutoREST configuration that customers can use to specify whether AutoREST should generate a parameterSet that returns an `HttpRequestMessage` object. This should be an opt-in config that generates a parameterSet with` -OutputRequest` switch parameter.
Our proposed batch request implementation will utilize the new parameterSet as such:
``` powershell
$managerRequest = Get-MgUserManager -UserId $userId -OutputRequest
$updateUserRequest = Update-MgUserSetting -UserId $userId -ContributionToContentDiscoveryAsOrganizationDisabled -OutputRequest
$removeGroupRequest = Remove-MgGroup -GroupId $groupId -OutputRequest
Invoke-MgBatchRequest -Request $managerRequest, $updateUserRequest, $removeGroupRequest
```
Related to https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/116
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.