title: How to add created certificate to an IIS https binding using PowerShell
body: <p>I can create a self signed certificate with PowerShell:</p>
  
  <pre><code>$cert = New-SelfSignedCertificate –DnsName www.test.com -CertStoreLocation “cert:\LocalMachine\My”
  </code></pre>
  
  <p>I also can create bindings for my site:</p>
  
  <pre><code>New-WebBinding -Name "Test" -IPAddress "*" -Protocol "https" -Port 443 -HostHeader www.test.com -SslFlags 1
  </code></pre>
  
  <p>However based on the documentation New-WebBinding has no parameter which accepts a certificate <a href="https://docs.microsoft.com/en-us/powershell/module/webadminstration/new-webbinding?view=winserver2012-ps" rel="nofollow noreferrer">see: New-WebBinding documentation</a></p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I properly create the https binding which is using the created certificate?</p>