Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-Confirm:$false set as global setting

Tags:

powershell

I have a few powershell scripts which trigger from a C# codepart.

They run non-interactive and there is no way to confirm any command.

In Powershell, we can set the ErrorActionPreference global with $ErrorActionPreference = "Stop"

Is there a same way to set on each command the confirm parameter to $false if it exists ?

like image 812
Solaflex Avatar asked Apr 22 '13 08:04

Solaflex


1 Answers

You can try with:

$ConfirmPreference = "None"

Read here

like image 178
CB. Avatar answered Oct 06 '22 00:10

CB.