Last active
September 24, 2021 09:43
-
-
Save bradmb/95c0372d280d118c159d80828dbf8c99 to your computer and use it in GitHub Desktop.
Add Let's Encrypt SSL Certificates To IIS Bindings via Powershell
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
if (-not (Test-Path -Path "C:\\certs\\win-acme")) { | |
$url = "https://github.com/win-acme/win-acme/releases/download/v2.1.7/win-acme.v2.1.7.807.x64.pluggable.zip" | |
$output = "C:\\certs\\win-acme.zip" | |
Invoke-WebRequest -Uri $url -OutFile $output | |
Expand-Archive "C:\\certs\\win-acme.zip" -DestinationPath "C:\\certs\\win-acme" | |
} | |
cd "C:\\certs\\win-acme" | |
if (-not (Get-WebBinding -Name "Default Web Site" -Protocol "http" -HostHeader "app.myhost.com")) { | |
New-WebBinding -Name "Default Web Site" -IPAddress * -Port 80 -Protocol "http" -HostHeader "app.myhost.com" | |
} | |
if (-not (Get-WebBinding -Name "Default Web Site" -Protocol "http" -HostHeader "app-2.myhost.com")) { | |
New-WebBinding -Name "Default Web Site" -IPAddress * -Port 80 -Protocol "http" -HostHeader "app-2.myhost.com" | |
} | |
.\wacs.exe --target iis --installation iis --siteid "1" --accepttos --emailaddress "[email protected]" --commonname "app.myhost.com" --closeonfinish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment