Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.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
Matlab Jenkins powershell块不会等到完成_Matlab_Powershell_Jenkins_Command Line_Command Prompt - Fatal编程技术网

Matlab Jenkins powershell块不会等到完成

Matlab Jenkins powershell块不会等到完成,matlab,powershell,jenkins,command-line,command-prompt,Matlab,Powershell,Jenkins,Command Line,Command Prompt,Jenkins powershell块不会等到完成,它似乎会转到下一个块,即Windows批处理命令。通过对所有变量进行echo测试,所有变量都可以正常工作,控制台输出显示了它们的正确值 Windows Powershell块 Start-Process -FilePath "C:\Program Files\MATLAB\R2018b\bin\matlab.exe" -ArgumentList "-automation -nosplash -nodesktop -wait -r `"echo

Jenkins powershell块不会等到完成,它似乎会转到下一个块,即Windows批处理命令。通过对所有变量进行echo测试,所有变量都可以正常工作,控制台输出显示了它们的正确值

Windows Powershell块

Start-Process -FilePath "C:\Program Files\MATLAB\R2018b\bin\matlab.exe" -ArgumentList "-automation -nosplash -nodesktop -wait -r `"echo ; cd $DOMAIN\Framework\Integration; setDOMAINPath $DOMAIN; disp(iAnalytics.domain.getSingleton.getRevision); createExecutable; exit`" -logfile $logfile" -Credential $credential -wait
然后它马上进入这个过程,可执行文件是由Matlab创建的,所以它找不到它,所以作业失败

Windows批处理命令

cd %Domain%\ModuleTest
DomainTestConsistency.exe

那么,有没有办法告诉Jenkins等待powershell进程结束,然后再等待多长时间执行下一个块?我尝试添加-wait和piping | out null,但没有任何效果。有什么想法吗?

你想用美元吗?自动变量。()如果上次操作成功,则返回TRUE;如果操作失败,则返回FALSE

#run first command 

if($? = "true")
{
    #run second command
}
else
{
Write-Host "first command has failed"
}

您将要使用$?自动变量。()如果上次操作成功,则返回TRUE;如果操作失败,则返回FALSE

#run first command 

if($? = "true")
{
    #run second command
}
else
{
Write-Host "first command has failed"
}

出现以下错误:无法将类型为“System.Management.Automation.InvocationInfo”的“System.Management.Automation.InvocationInfo”值转换为类型为“System.Management.Automation.PSBoundParametersDictionary”。@JCLopez是否尝试测试$?变量,其中包含一个您知道可以成功运行的简单语句。该变量给了我以下错误:无法将类型为“System.Management.Automation.InvocationInfo”的“System.Management.Automation.InvocationInfo”的“System.Management.Automation.InvocationInfo”值转换为类型为“System.Management.Automation.PSBoundParametersDictionary”。@JCLopez尝试测试$?变量,该变量包含一条您知道可以成功运行的简单语句。