What is ConfirmPreference in PowerShell
Learn what ConfirmPreference is in PowerShell.
February 14, 2016
Q. What is $ConfirmPreference in PowerShell?
A. You may notice that sometimes in PowerShell you are prompted to confirm an action, other times you are not. Every cmdlet has an impact level which if its equal or higher than the $ConfirmPreference you will be prompted for confirmation. To view the current $ConfirmPreference just view the variable which should be High. If, for example, you set $ConfirmPreference to "Medium" you will be prompted when stopping processes but are not if the $ConfirmPreference is the default "High". Note that if you lower the $ConfirmPreference you can avoid the confirmation by adding -confirm:$false to the command. You can also set $ConfirmPreference to "None" to never get prompted for confirmation.
About the Author
You May Also Like