Skip to content

Instantly share code, notes, and snippets.

@galenemery
Created October 29, 2015 19:41
Show Gist options
  • Save galenemery/b885be98987d2e856dc3 to your computer and use it in GitHub Desktop.
Save galenemery/b885be98987d2e856dc3 to your computer and use it in GitHub Desktop.
Install Certificate to a certificate store.
%W{ Root CA }.each do |cert_store|
powershell_script "import_cert_to_#{cert_store}" do
code <<-EOH
$certpath = "#{Chef::Config[:file_cache_path]}\\self_cert.cer"
$certstore = "cert:\\LocalMachine\\#{cert_store}"
Import-Certificate -FilePath $certpath -CertStoreLocation $certstore
EOH
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment