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 merge previous examples with creation of an https binding in a web site.
import-module webadministration
$computerName = $Env:Computername
$domainName = $Env:UserDnsDomain
New-WebBinding -Name "MyWebSite" -IP "*" -Port 443 -Protocol https
Get-ChildItem cert:\LocalMachine\My | where { $_.Subject -match "CN\=$Computername\.$DomainName" } | select -First 1 | New-Item IIS:\SslBindings\0.0.0.0!443