gpt4 book ai didi

powershell - 通过Jenkins运行Powershell脚本时出现此错误: “NativeCommandError” not sure how to use invoke-command

转载 作者:行者123 更新时间:2023-12-03 08:38:28 45 4
gpt4 key购买 nike

Ignoring an errorlevel != 0 in Windows PowerShell (ISE)
我已经阅读了此链接,但是不确定如何运行“Invoke-Command”,我的$ ErrorActionPreference是“continue”。
这是我得到的错误:
06:06:55 +和powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command'&''E:...
06:06:55 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
06:06:55 + CategoryInfo:未指定:(root:2020-10 -... something:String)[],RemoteException
06:06:55 + FullyQualifiedErrorId:NativeCommandError

最佳答案

$errorActionPreference应该在脚本块内定义,例如:

Invoke-Command {$ErrorActionPreference = 'SilentlyContinue'; REST OF THE CODE}

关于powershell - 通过Jenkins运行Powershell脚本时出现此错误: “NativeCommandError” not sure how to use invoke-command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64401415/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com