title: Launch msiexec as an admin through powershell
body: <p>I'm having trouble with a piece of code that I'm trying to get working in regards to executing an MSI application.
  I need to pass credentials that are stored in a variable and then pass those credentials through a "runas" to the MSI package so that it is installed with the escalated credentials I pass to the application.</p>
  
  <p>Here is the section of code I am having trouble with.</p>
  
  <pre><code>if($filter -like "*.msi")
  {
      Start-Process -FilePath "msiexec $FullFilePath" -Credential $adminCreds -ArgumentList "-noprofile -command &amp;{Start-Process /i $FullFilePath /passive /norestart -verb runas}" -Wait -WorkingDirectory $path
      exit
  }
  </code></pre>
  
  <p>My variables are as follows: </p>
  
  <pre><code>$filter = Get-ChildItem $path -Filter $($installer[$i]) -name
  $FullFilePath = $path + "\" + $filter
  $path = Split-Path $script:MyInvocation.MyCommand.Path
  </code></pre>
  
  <p>Thanks in advance!</p>