title: How to get all certificates with powershell?
body: <p>I am trying to get all certificates with powershell. When I set "\$computer\My" as store location below script returns user certificates I think. </p>
  
  <p>When I set "\$computer\root" it returns root certificates. How can I get both user and machine certificates?</p>
  
  <pre><code>$computer='localhost';
  $ro=[System.Security.Cryptography.X509Certificates.OpenFlags]"ReadOnly"
  $lm=[System.Security.Cryptography.X509Certificates.StoreLocation]"LocalMachine"
  $store=new-object System.Security.Cryptography.X509Certificates.X509Store("\\$computer\My",$lm)
  $store.Open($ro)
  $certificates=$store.Certificates
  </code></pre>