You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ShouldProcess/ConfirmImpact to Uninstall-PSResource #433
Look into adding a confirmation requirement when uninstalling a PSResource. Uninstall-Module does not do it, and maybe we should not do it for Uninstall-PSResource when a single specific module is uninstalled. But since Uninstall-PSResource handles Name wild card characters, we may want to prompt for confirmation in that case.
Uninstall-PSResource MyModule #No confirmation promptUninstall-PSResource*#Prompt for confirmation before uninstalling all modules.Uninstall-PSResource*-Force #No confirmationUninstall-PSResource*-Confirm:$false??
Please do not add additional hurdles when using wildcards. These kinds of extra barriers is what made PowerShellGet v2 so difficult to use since it basically forces people to add -Force or -Confirm:$false to $PSDefaultParameterValues. PowerShell should just do whats its told. Its the user responsibility to make sure they're not doing something dumb. The level of destructiveness is fairly small in the grand scheme of things. In worst case if I uninstall all my modules I can just as easily reinstall. PowerShell has sufficient safeguards with -WhatIf and -Confirm if the user is concerned what the command will do when ran and can compare to the expected result.
If you need further convincing lets take a look at Remove-Item. I can pass it wildcards or at worst delete all files and folders without any additional prompts and that can be way more destructive than removing a module.
"If you need further convincing lets take a look at Remove-Item . I can pass it wildcards or at worst delete all files and folders without any additional prompts and that can be way more destructive than removing a module."
That seems like a terrible argument entirely ignorant of the deep history behind --no-preserve-root on *IX/Linux systems. If anything, Remove-Item should receive augmentation(s) in that regard…
Also for -WhatIf and -Confirm to actually work, one has to implement a ShouldProcess code block ANYWAY.
Maybe you meant to voice a preference for the (future) value(s) of ConfirmImpact (i.e. High/Medium/Low) here?
Also while I totally get your anger, it seems a bit… ignorant of the many things which can drive people to add those to $PSDefaultParameterValues (also, let's not forget about $ConfirmPreference )
Activity
StevenBucher98 commentedon Jan 19, 2022
Should this always prompt you?
ThomasNieto commentedon Jul 4, 2022
Steven Bucher (@StevenBucher98) No, it should not.
Please do not add additional hurdles when using wildcards. These kinds of extra barriers is what made PowerShellGet v2 so difficult to use since it basically forces people to add
-Forceor-Confirm:$falseto$PSDefaultParameterValues. PowerShell should just do whats its told. Its the user responsibility to make sure they're not doing something dumb. The level of destructiveness is fairly small in the grand scheme of things. In worst case if I uninstall all my modules I can just as easily reinstall. PowerShell has sufficient safeguards with-WhatIfand-Confirmif the user is concerned what the command will do when ran and can compare to the expected result.If you need further convincing lets take a look at
Remove-Item. I can pass it wildcards or at worst delete all files and folders without any additional prompts and that can be way more destructive than removing a module.no-identd commentedon Mar 14, 2023
Thomas Nieto (@ThomasNieto)
That seems like a terrible argument entirely ignorant of the deep history behind
--no-preserve-rooton *IX/Linux systems. If anything, Remove-Item should receive augmentation(s) in that regard…Also for
-WhatIfand-Confirmto actually work, one has to implement aShouldProcesscode block ANYWAY.Maybe you meant to voice a preference for the (future) value(s) of
ConfirmImpact(i.e. High/Medium/Low) here?Also while I totally get your anger, it seems a bit… ignorant of the many things which can drive people to add those to
$PSDefaultParameterValues(also, let's not forget about$ConfirmPreference)