title: running ec2config.exe -sysprep remotely using powershell
body: <p>I am working through a process for creating an AMI from instance, for that i need to run sysprep before shutting down the machine and then create an AMI from it.</p>
  
  <p>trouble is whatever i do using powershell, it wont execute sysprep.</p>
  
  <p>this is what my invoke-comment looks like right now</p>
  
  <pre><code>$securePassword = ConvertTo-SecureString $newAdminPassword -AsPlainText -force
  $credential = new-object -typename System.Management.Automation.PsCredential(".\Administrator",$securePassword)
  Invoke-Command -ComputerName $hostName -ScriptBlock { Start-Process "C:\Program Files\Amazon\Ec2ConfigService\Ec2Config.exe" -ArgumentList '-sysprep' -NoNewWindow -PassThru  -Verbose -R} -Credential $credential
  </code></pre>
  
  <p>it doesnt run this command, simply prints out this output</p>
  
  <pre><code>Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName                    PSComputerName
  -------  ------    -----      ----- -----   ------     -- -----------                    --------------
        7       1      252        108     3     0.00   2556 Ec2Config                      10.1.7.254
  </code></pre>
  
  <p>any idea what's wrong here ? </p>