Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell -确认不工作_Powershell - Fatal编程技术网

Powershell -确认不工作

Powershell -确认不工作,powershell,Powershell,我想跑 Set-SPManagedAccount -Identity $SPUser -ExistingPassword $nPassword -Confirm 但它要求我再次确认。我通过更改$confirmpreference尝试了另外两种方法,但都没有用。我不知道它为什么要求确认。如何停止请求确认?您需要显式地将确认的值设置为$false,以避免出现提示: Set-SPManagedAccount -Identity $SPUser -ExistingPassword $nPassword

我想跑

Set-SPManagedAccount -Identity $SPUser -ExistingPassword $nPassword -Confirm

但它要求我再次确认。我通过更改
$confirmpreference
尝试了另外两种方法,但都没有用。我不知道它为什么要求确认。如何停止请求确认?

您需要显式地将
确认
的值设置为
$false
,以避免出现提示:

Set-SPManagedAccount -Identity $SPUser -ExistingPassword $nPassword -Confirm:$false