What is ConfirmPreference in PowerShell

Learn what ConfirmPreference is in PowerShell.

John Savill

February 14, 2016

1 Min Read
What is ConfirmPreference in PowerShell

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(s)

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like