Forum Discussion

vetadmin's avatar
vetadmin
Copper Contributor
Jul 28, 2022
Solved

Start-process launches windows installer

I think there is something I am missing that when I try to run the installer for an msp file and using this syntax it stops and brings the windows installer window.   Start-Process msiexec.exe -Fil...
  • LainRobertson's avatar
    Jul 29, 2022

    vetadmin 

     

    You've provided the parameters incorrectly.

     

    First, here's the commandlet's reference article:

     

     

    Next, here are the issues from your command line:

     

    • You have placed msiexec.exe on its own when it should follow the "-FilePath" parameter;
    • The -FilePath parameter is pointing to the MSP file when it should be referring to msiexec.exe;
    • The MSP file should be after msiexec's "/p" parameter;
    • There is no "/p" parameter;
    • The argument list is supposed to be an array of strings but you have a single string containing all parameters. Most of the time you can actually get away with this for traditional DOS-style commands (as msiexec.exe is) but it's not in line with how -ArgumentList should be used and will break in many PowerShell scenarios where it can be more fussy about such things.

     

    So, what should the command look like? (noting that I haven't not bothered checking the validity of the msiexec.exe parameters)

     

    Start-Process -FilePath msiexec.exe -ArgumentList @("/p", "$Installdir\AcrobatDCx64Upd2200120169.msp", "/sAll", "/rs", "/rps", "/msi", "/norestart", "/quiet EULA_ACCEPT=YES");

     

    Cheers,

    Lain

Resources