Run MsiExec from PowerShell and get Return Code

前端 未结 3 1389
庸人自扰
庸人自扰 2020-12-25 11:44

With BAT/CMD script I can simply use \"msiexec /i /quiet /norestart\" and then check %errorlevel% for the result.

3条回答
  •  粉色の甜心
    2020-12-25 12:19

    You can also use the powershell app deployment kit which provides several things.

    Then you can use for example

    Execute-MSI -Action 'Install' -Path "$dirFiles\your.msi" -AddParameters "INSTALLFOLDER=C:\$appFolder"
    

    info http://psappdeploytoolkit.com/

提交回复
热议问题