07/17/2018 717 views

I am trying to install two msi files but when I run the arguments fail. Additionally, I need to have the application -wait before installing the second application. I cannot seem to figure this one out.

$argumentlist = "/i anyconnect-win-4.6.01103-core-vpn-predeploy-k9.msi /qn /l*v C:\IT\Service Desk Tools\Logs\AnyConnect-K9.log"

$application = "anyconnect-win-4.6.01103-core-vpn-predeploy-k9.MSI"

$argumentlist = $argumentlist.Replace("anyconnect-win-4.6.01103-core-vpn-predeploy-k9.msi",$application)

Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList $argumentlist

$argumentlist = "/i anyconnect-win-4.6.01103-gina-predeploy-k9.msi /qn /l*v C:\IT\Service Desk Tools\Logs\AnyConnect-Gina.log"

$application = "anyconnect-win-4.6.01103-gina-predeploy-k9.MSI"

$argumentlist = $argumentlist.Replace("anyconnect-win-4.6.01103-gina-predeploy-k9",$application)

Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList $argumentlist

0 Comments   [ + ] Show comments


All Answers

- I'm not sure what the 'replace' line is for?
- You probably need to use Start-Process with -Wait
- Be careful of spaces in paths
Answered 07/18/2018 by: captain_planet
Black Belt