title: Python execute powershell command
body: <p>I am try to execute a PowerShell command to get the memory usage and get the result.</p>
  
  <pre><code>import subprocess
  output = subprocess.call(["powershell.exe", "Get-Counter -Counter "+'"\memory\\available mbytes"'+" -MaxSamples 10 -SampleInterval 1"])
  try:
      subprocess.check_output("Get-Counter -Counter "+'"\memory\\available mbytes"'+" -MaxSamples 10 -SampleInterval 1", shell=TRUE)
  except subprocess.CalledProcessError, e:
      print "subproces CalledProcessError.output = " + e.output
  
  print output
  </code></pre>
  
  <p>It is success to execute the command, but only get the following result: </p>
  
  <pre><code>subproces CalledProcessError.output = 
  0
  </code></pre>
  
  <p>How can I get the PowerShell result back?</p>