Solved

Installing msi package using required software

  • 28 February 2024
  • 3 replies
  • 135 views

Badge

Hello everyone. I have been trying to find some examples, and I thought what I put would work, but its not. I am trying to install an msi package that has some extra arguments. For example, If I run this from a command line it works on a computer:

 

msiexec /i agentmanagersetup.msi /qn DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1

 

When using automox it has me do some of this in quotes and parentheses and this is where I am not sure what to do. I currently have this but its not working:

 

exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"agentmanagersetup.msi DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1"') -Wait -Passthru).ExitCode

If I removed the DEVREGCODE and TENANT arguments and put them in their own quotes i would get an error about a token. If i put it the way I have it above, it doesnt seem like its running as i dont even see a failed in the activity report.

Not sure What I am doing wrong. Also, because the install has specific to our company, I replaced that data with the X’s.

icon

Best answer by jack.smith 1 March 2024, 20:29

View original

3 replies

Userlevel 5
Badge +1

Give this a try.

$install = Start-Process -FilePath msiexec.exe -ArgumentList ('/i agentmanagersetup.msi DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1 /qn') -Wait -Passthru
Write-Output "Install ExitCode: $($install.ExitCode)"

 

 

Badge

Thank you. I will give this a try.

Badge

That worked, thank you very much.

Reply