I'm trying to install an MSI using a PowerShell script, and it works fine when I run it locally (via Start-Process with the appropriate parameters). However, when I attempt to use 'Invoke-Command' to run it remotely, it fails, potentially due to not getting the required 'Run As Administrator' context. I consistently get exit code 3, and my MSI log shows issues related to service actions. Can anyone offer insights or solutions? Here are the specific commands I've been using locally: Start-Process 'msiexec.exe' -Wait -Verb runas -ArgumentList '/i \publictoolsinstallablesexecslightspeedSmartAgentx64-3.1.2.msi /passive /log C:msiexec.log'. Any help would be greatly appreciated!
1 Answer
You might not need the 'Run As Administrator' since `Invoke-Command` should already run with elevated privileges if your user is an admin on the remote machine. Also, some installers require a full desktop session to run correctly. Check the logs for any additional errors that might provide more details.
I've added more details to the original post with the specific log errors.