Find exit code for executing a cmd command through PowerShell

前端 未结 3 1924
再見小時候
再見小時候 2020-12-20 16:33

I am using a silent installation command to install software. I am running this command from PowerShell 3.0.

$silentInstall = C:\\Users\\Admin\\Documents\\Se         


        
3条回答
  •  被撕碎了的回忆
    2020-12-20 17:04

    You shouldn't need to use Invoke-Expression:

    & C:\Users\Admin\Documents\Setup-2.0.exe /s /vEULAACCEPTED=Yes /l*v C:\install.log /qn
    

提交回复
热议问题