Post-renewal script for binding new certificate to Remote Desktop Gateway

I think on a default Essentials 2016 a bit more is needed before your script will work. It needs Install-WindowsFeature RSAT-RDS-Gateway because that is not installed by default.