Azure / Azure/autorest.powershell
Configuration for Force/ShouldContinue pattern
- Dominant language
- C#
- Stars
- 123
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Need a configuration option `AddForceParameter` with a configuration parameter `hasSecurityImpact` ($true or $false) to add Force/ShouldContinue pattern to generated cmdlets that implement ShouldProcess.
In the proposed pattern implementation, when this is activated, a `SwitchParameter` called `Force` is added to all parameter sets, and the cmdlet execution in `ProcessRecord` is changed as w follows:
```powershell
if (ShouldProcess(, )) {
if (Force.IsPresent || ShouldContinue("Perform the operation'' on ''?", "ShouldConfirm Prompt", , ref bool, ref bool)) {
ProcessRecordAsync()
...
}
}
```
This will always print the provided prompt, no matter what settings are selected.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.