title: SSL certificate conditional check using chef
body: <p>I am working on a chef code that imports the certificate to the personal store using the pfx file, and add the https binding in the IIS and add the ssl certificate. I am successful with the code, and the code looks like below.</p>
  
  <p>However i would like to put a conditional check before i run these steps, i.e if the ssl certificate is already available on the https binding on  IIS, i do not want to run any of the below script.</p>
  
  <p>Could you help me with that first line of 'IF' statement on how to see if the SSL is already installed?</p>
  
  <pre><code># Import certificates to local machine personal store
  windows_certificate 'cert.pfx' do  
      pfx_password    '@password'  
  end
  
  #Setup a HTTPS port on IIS
  iis_site 'Default Web Site' do  
    action :config  
    bindings 'http/*:80:,https/*:443:'  
  end
  
  #Add the certificate to the IIS 
  windows_certificate_binding 'ssl certificate name' do  
    address '0.0.0.0'  
  end
  </code></pre>