Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
112 stars 78 forks source link

Confirm impact should be set to high for destructive cmdlets #1107

Closed peombwa closed 1 year ago

peombwa commented 1 year ago

Given PowerShell's guideline on requesting confirmation for destructive cmdlets, AutoREST.PowerShell should set confirmImpact to high when generating Remove-* cmdlets.

Currently, Remove-* cmdlets are generated with a confirmImpact of medium. Since both ConfirmImpact and $ConfirmPreference are set by default to Medium, this means that, by default, no confirmation prompt is shown, and the cmdlet executes normally despite the destructive nature of Remove-* cmdlets.

Reference: https://github.com/Azure/autorest.powershell/blob/c5696cc48b1f1f68ae517f149fa060b5623e9046/powershell/generators/script-cmdlet.ts#L93

dolauli commented 1 year ago

This one is duplicated as https://github.com/Azure/autorest.powershell/issues/307.