1
votes

I've been asked to automate a large MSI installer using Powershell. This installer has tons of install options and i'm running the options one by one in the syntax shown below.

I have this setup to run all the install options, then check the logs for any failures in the logs and send me an email notification. The issue I can't solve is that if an install option fails the installer running in poweshell is throwing an error box to the UI and pausing the install. This is a problem as I need all installs to run, then assess what has failed and fix in a timely manner. Is this normal behavior or can I modify my code below to not show error messages in the UI?

#Common items
$SourceDirectory = "D:\Temp"
$LogDirectory = "D:\Temp\Script"
$FileName = Get-ChildItem -Path $SourceDirectory | Sort-Object LastAccessTime -   Descending | Select-Object -First 1
$FullFileName = $SourceDirectory + "\" + $FileName

#Install option 1
$LogName =  $LogDirectory + "\" +"(MSIName).log"
$Arguments = "/i ""$FullFileName"" /qn /norestart /L*V $LogName ADDLOCAL=(install options)"
Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait

#Install option 2
$LogName =  $LogDirectory + "\" +"(MSIName).log"
$Arguments = "/i ""$FullFileName"" /qn /norestart /L*V $LogName ADDLOCAL=(install options)"
Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait

What am i missing here? I'm running as /qn.

1

1 Answers

2
votes

It's possible for a badly-authored installer to show UI even in quiet mode. Check a verbose log to see where the message is coming from.