【发布时间】:2021-11-04 16:19:17
【问题描述】:
您好,我一直在处理的这行代码有问题,由于某种原因不再工作我正在尝试静默调用 MSI 安装程序并等待它完成,以便我可以执行下一行代码有它工作但现在没有,我尝试执行启动进程并使用 -wait 参数,但它返回一条错误消息,当我调用“msiexec.exe”时它没有 -wait 参数
msiexec.exe /i "C:\MagtekCC\Files\Java\jre1.8.0_144.msi" /QN TRANSFORMS="jre1.8.0_144.mst" /L*V "C:\Temp\msilog.log"
Write-Host -NoNewLine "Done.`n" -ForegroundColor Cyan
Start-Sleep -s 2
start-process msiexec.exe "/i C:\MagtekCC\Files\Java\jre1.8.0_144.msi" -wait /QN TRANSFORMS="jre1.8.0_144.mst" /L*V "C:\Temp\msilog.log"
Write-Host -NoNewLine "Done.`n" -ForegroundColor Cyan
Start-Sleep -s 2
> Start-Process : A positional parameter cannot be found that accepts argument '/QN'.
At line:1 char:1
+ start-process msiexec.exe "/i C:\MagtekCC\Files\Java\jre1.8.0_144.ms ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
【问题讨论】:
-
再次感谢您的帮助刚刚标记了您提供的答案我试图找到接受它的按钮但您帮我找到了它
-
很高兴听到这个消息;我的荣幸。
-
@Eslendil,你为什么把这个发布为your own question的副本,然后是plagiarize@mklement0's answertwice?
-
这能回答你的问题吗? Java Silent installer command
-
对不起,我对这个网站的功能还很熟悉,如果我做错了什么,我深表歉意
标签: java powershell windows-installer synchronous