title: Script Block powershell remote MSI Installation
body: <p>Hi I was trying to execute MSI from build machine A(cttfs) and install that MSI on Machine B(c2devint); output is website on Machine B.</p>
  
  <p>Please help me fixing the powershell script which is on Machine A with MSI installer.This script is run from Machine A</p>
  
  <pre><code>$cred = Get-Credential username
  $session = new-PSSession -name c2devint -credential $cred
  Invoke-Command -ScriptBlock {Invoke-Command -Session $session -ScriptBlock {Start-Process "msiexec.exe" -ArgumentList "/i C:\DailyBuild\DirectMSI.msi INSTALLLOCATION=D:\Websites\DirectDevInt ENVPROPERTY=DEV /qb" -Wait} -ComputerName c2devint}
  Remove-PSSession $session
  </code></pre>
  
  <p>Here is the error</p>
  
  <pre><code> Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
      At line:3 char:44
      + Invoke-Command -ScriptBlock {Invoke-Command &lt;&lt;&lt;&lt;  -Session $session -ScriptBlock {Start-Process "msiexec.exe" -ArgumentList "/i C:\DailyBuild\DirectMSI.msi INSTALLLOCATION=D:\Websites\DirectDevInt ENVPROPERTY=DEV /qb" -Wait} -ComputerName c2devint}
          + CategoryInfo          : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
          + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
  </code></pre>
  
  <p>And also please help me how to pass username &amp; pwd to this script</p>