I'm using Powershell on Win 2008r2 to make a remote call to msiexec as follows:
Invoke-Command -session $Session -ScriptBlock{param($arguments) start-process -FilePath "msiexec.exe" -Wait $arguments } -Argument $arguments
Currently I'm checking for success using if(!$?) but this is no good because I've just seen the msiexec process throw a 1638 error (because the app is already installed on the remote server) but the value of $? was True.
Can anyone please tell me how I can capture the 1638 code, or whatever else, is returned by msiexec on the remote server?
Thanks, Rob.