- 确认:$ false设置为全局设置

Sol*_*lex 6 powershell

我有一些从C#代码部分触发的powershell脚本.

它们运行非交互式,无法确认任何命令.

在Powershell中,我们可以设置ErrorActionPreference全局$ErrorActionPreference = "Stop"

是否有相同的方法在每个命令上设置confirm参数为$ false(如果存在)?

CB.*_*CB. 4

您可以尝试:

$ConfirmPreference = "None"
Run Code Online (Sandbox Code Playgroud)

在这里阅读