title: Powershell - Set SSL Certificate on https Binding
body: <p>I am trying to use PowerShell to set the SSL certificate on an IIS site for a self signed/local certificate.</p>
  
  <p>I create the certificate:</p>
  
  <pre><code>$newCert = 
         New-SelfSignedCertificate 
         -DnsName www.mywebsite.ru 
         -CertStoreLocation cert:\LocalMachine\My
  </code></pre>
  
  <p>Then try to set the SSL bindings:</p>
  
  <pre><code>get-item 
        cert:\LocalMachine\MY\$newCert.Thumbprint | 
        new-item -path IIS:\SslBindings\0.0.0.0!443
  </code></pre>
  
  <p>as shown on this post: <a href="http://www.iis.net/learn/manage/powershell/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in" rel="noreferrer">http://www.iis.net/learn/manage/powershell/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in</a></p>
  
  <p>also shown here:
  <a href="https://stackoverflow.com/questions/2628970/powershell-iis7-snap-in-assign-ssl-certificate-to-https-binding">Powershell IIS7 Snap in Assign SSL certificate to https binding</a></p>
  
  <p>I also tried:</p>
  
  <pre><code>get-item 
        cert:\LocalMachine\MY\$newCert.Thumbprint | 
        new-item -path IIS:\SslBindings\*!443
  </code></pre>
  
  <p>To no avail, I'm not seeing the SSL Certificate set in the Edit Site Binding dialog.</p>
  
  <p>Any thoughts?</p>