I have a PowerShell script to install an MSI that I have successfully created which works when running at the computer. I have then taken the script and ran it inside a script block using invoke-command and as well using enter-pssession and both ways it succeeds but it will not register the software with the main program it works with (configuration.xml file should be updated but is not). All PowerShell and command-line sessions are run with elevated network admin creds as we make use of UAC. The installation files contain a registration tool(exe) which I can run successfully (with code) from both PowerShell and command line locally and it updates the configuration.xml. Once I run the registration tool remotely (invoke-command, enter-pssession, psexec) it all runs and does not return an error but it does not work (does not update configuration.xml).
I have logged the installs and no issues and even viewer shows successfull installs every time.
There is something about running in a remote session that is messing with the registration and cannot figure it out.
Here is some more info to better show what I have done
Software Installs = Program installs
Software Registers = ClientSettings.xml file is updated
MSI Installation Code:
Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I "C:\Installs\SOFTWARE\Files\SOFTWARE.msi" ALLUSERS="1" COUNTRY=OP ALLOWWEBUPDATES=0 ALLOWREMOTESERVICES=0 STANDALONE=No INSTALLCOUNSELING=No ADDLOCAL=Media,Common,Algorithm,ProgramFiles,CompactSQL2005,FlexNetConnect,FusePlatform,LanguageIndependent,RatataskPlatform,SpecSaversOnly /quiet'
#(software installs, software registers)
Run the above remotely:
invoke-command -computername MYPC -scriptblock {Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I "C:\Installs\SOFTWARE\Files\SOFTWARE.msi" ALLUSERS="1" COUNTRY=OP ALLOWWEBUPDATES=0 ALLOWREMOTESERVICES=0 STANDALONE=No INSTALLCOUNSELING=No ADDLOCAL=Media,Common,Algorithm,ProgramFiles,CompactSQL2005,FlexNetConnect,FusePlatform,LanguageIndependent,RatataskPlatform,SpecSaversOnly /quiet' }
#(software installs, software does not register) I found the failure is the registration.exe tool
Run the registration tool locally:
start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software registers)
Run the registration tool remotely:
invoke-command -computername MYPC -scriptblock {start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'}
#(software doesn't register) No errors are produced and event viewer shows no errors
Run remotely using enter-pssession:
enter-pssession
start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software doesn't register) No errors are produced and event viewer shows no errors
Register using PSEXEC:
cmd /c '"C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe" /R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software doesn't register)