Created
March 9, 2015 09:41
-
-
Save DamianStanger/e42562fe3b0e4c745b6a to your computer and use it in GitHub Desktop.
IIS Certificate installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write-host "Apply the certName cert" -ForegroundColor Green | |
$cert = dir cert:\localmachine\my | where-object{$_.subject -like "*.certName.*"} | |
if(!$cert){ | |
$cert = dir cert:\localmachine\webhosting | where-object{$_.subject -like "*.certName.*"} | |
} | |
if(!$cert){ | |
throw [System.Exception] "No ssl cert found that matches the search '*.certName.*'" | |
} | |
new-item "IIS:\SslBindings\0.0.0.0!443" -Value $cert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment