As part of our automated build procedure we are trashing and reconstructing our IIS site with powershell scripts.
Once i have created the AppPool and the website com
You can make the script simpler like this:
Get-ChildItem cert:\LocalMachine\Root | where { $_.Subject -like "YOUR STRING HERE*" } | select -First 1 | New-Item IIS:\SslBindings\0.0.0.0!443
Use 0.0.0.0 to target all hosted IP's (equivalent to "*" in IIS Manager) or replace it with a specific IP if needed.