This part is about automating the install and doing some smart hings around managing IIS and Remote Desktop.
Key point to cover in this article:
Part 1: Powershell Update Script (automates updates needed to get Certbot to work on Windows)
Part 2: PowerShell Automated Install Script Concepts
Part 3: PoweShell Automated Install Script (Finished Product)
Part 4: IIS Audit Script (Python)
Part 5: IIS Authentication Script (Python Hook Script HTTP and TLS-SNI)
Part 6: IIS Install Script (Python Hook Script)
Part 7: IIS Verification Scripts (Python)
Part 8: IIS Install Scripts (Zope.Interfaces)
Most of the functions are self explanatory but are described a bit more below.
The script is also designed to be modular so if you get stuck on one component you can re-run just that component.
downloadPythonInstallerPIPCert - downloads latest version of 64-bit python to %TEMP% installPythonPIPCert - Installs Cert and Python installPIPVENV - Downloads Get-PIP.py scripts and gets pip. Then uses pip to install virtualenv and virtualenvwrapper (easier virtual environment management)
createVirtualCertbotEnvs() - creates a virtual environment installCertbotInVENVS() - install certbot in a virtual environment fixCertbotFiles() - fixes certbot as per post 1
If everything works well you should get 3 environments that look like below and the %TEMP% folder should have the 3 files we downloaded. You can also verify certbot works in all 3 environments.