title: Powershell Start-Process msiexec on a remote machine not working
body: <p>For some reason Start-Process msiexec won't work when run through invoke command on a remote machine. I looked it up and while some people recommend using psiexec i have seen a lot of people using the plain old invoke-command to start msi installers on remote machines. </p>
  
  <p>This is the code i am currently using:</p>
  
  <pre><code>$session = New-PSSession -computername $computerName -ea stop
  
  $command = {
  
      Param(
      [Parameter()]
      [string]$computerName,
  
      [Parameter()]
      [string]$domain,
  
      [Parameter()]
      [string]$user,
  
      [Parameter()]
      [string]$password,
  
      [Parameter()]
      [string]$installDir
      )
  
      $msiArgumentList = "/i C:\Installer.msi /l c:\log.txt /quiet /qr /norestart IAGREE=Yes DOMAIN=$domain ACCOUNT=$user PASSWORD=$password PASSWORDCONFIRM=$password INSTALLDIR=$installDir"
  
          Start-Process msiexec -ArgumentList $msiArgumentList -Wait
  
  }
  
  Invoke-Command -session $session -ScriptBlock $command -ArgumentList $computerName, $domain, $user, $password, $installDir
  
  Remove-PSsession -session $session
  </code></pre>
  
  <p>I used the same method to install services remotely using intallutil and it worked. Scripting is enabled on target machine as well as remoting so by all accounts it should work. Both computers have the same credentials but i still tried adding credentials to both invoke-command and the pssession. I tested the code locally and the installation worked. Remotely it doesn't and no errors what so ever. i can see on the target machine in taskmanager that msiexec is started but nothing happens. I even tried disabling the firewall and still nothing. i tried the &amp; operator to start msiexec and still nothing.</p>
  
  <p>Not sure what else i could try.</p>