In a batch file you would use Start msiexec file.msi /wait
In Powershell is similar and it's very good specially for Task Sequences.
First let's create an array with the msi files.
$msi = @("c:\file1.msi", "c:\file2.msi", "c:\file2.msi")
Now we call the Start-Process and wait one to finish before starting the next.
foreach($_ in $msi)
{Start-Process -FilePath msiexec -ArgumentList /i, $_, /qn -Wait}You can also output the result to null and it will wait for its finish:
foreach($_ in $msi){msiexec /i $_ /qn | out-null}
No comments:
Post a Comment