I am trying to perform a silent install of IBM Rational Doors 9.7 as explained here.
I want to perform the install with Powershell. I am constructing the arguments to Start-Process to run the installer like this:
$doors97installArgs = '/s /v"/l*v"install.log" /qn INSTALLDIR="C:\Program Files\IBM\Rational\DOORS\9.7.2.3\" CLIENTDATA="36990@<redacted>" LAPAGREE="Yes" TLLICENSESERVER="27200@<redacted>" -wait -verb open'
For Start-Process I am using this:
Start-Process -WorkingDirectory $doors97location -FilePath $doors97setupFullPath -ArgumentList $doors97installArgs
The values in $doors97location and $doors97setupFullPath evaluate correctly.
When Start-Process runs it immediately exits with no error message. What am I doing wrong?
There are two problems with your command:
You mistakenly included
-waitand-verb openinside the argument-list string passed toStart-Process.-Verb Openis redundant, as it is implied. (-Verbis typically only used withRunAs, to request execution _with elevation).The argument-list string is broken in that the embedded
"chars. inside/v"..."aren't escaped.However, since your intent is to run synchronously (
Start-Process -Wait), for simplicity I suggest calling viacmd /cinstead, which is implicitly synchronous while giving you the same control over the quoting on the resulting process command lines as withStart-Process; additionally, the installer process' exit code will be reflected in the automatic$LASTEXITCODEvariable afterwards.Based on the docs you link to, try the following (using an expandable here-string to make use of embedded quotes easier):
After this call,
$LASTEXITCODEcontains the installer's exit code.