Azure / Azure/autorest.powershell

Revise Set cmdlet variants, update ValueFromPipeline parameter name

Open
#426 1 comment 0 reactions 0 assignees View on GitHub
discussion
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Currently, you get something like this:
```powershell
### Update (Default)
Set-AzNsg -Name -ResourceGroupName -SubscriptionId
[-Parameter ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
[]

### UpdateExpanded
Set-AzNsg -Name -ResourceGroupName -SubscriptionId
[-DefaultSecurityRule ] [-Etag ] [-Id ] [-Location ]
[-ProvisioningState ] [-ResourceGuid ] [-SecurityRule ] [-Tag ]
[-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] []
```

Instead, we want something like this:
```powershell
### Update (Default)
Set-AzNsg -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
[]

### UpdateExpanded
Set-AzNsg -Name -ResourceGroupName -SubscriptionId
[-DefaultSecurityRule ] [-Etag ] [-Id ] [-Location ]
[-ProvisioningState ] [-ResourceGuid ] [-SecurityRule ] [-Tag ]
[-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] []
```

Basically, the non-Expanded variant needs to have a single parameter, `InputObject`, that is the type of the body parameter (in this case, `INetworkSecurityGroup`). This replaces the path parameters (Name, ResourceGroupName, SubscriptionId) with the separate body parameter.

Additionally, any time a body parameter is created (aka, a ValueFromPipeline parameter), we name it `InputObject`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.