Skip to content

Instantly share code, notes, and snippets.

@timcunningham
Created January 13, 2020 16:55
Show Gist options
  • Save timcunningham/49dead0f6dc2d0cb6b85bc74c11cdee1 to your computer and use it in GitHub Desktop.
Save timcunningham/49dead0f6dc2d0cb6b85bc74c11cdee1 to your computer and use it in GitHub Desktop.
$name = $args[0] #-- Name and folder name of project
$site =$args[1] #-- site name like www.foo.com
$config = $args[2] #-- cfconfig json file to setup datasources etc..
if (!(Get-Module -ListAvailable -Name IISManager)) {
Install-Module -Name IISManager -Confirm:$False -Force
}
if (!(Get-Module -ListAvailable -Name Hosts)) {
Install-Module -Name Hosts -Confirm:$False -Force
}
Import-Module -Name IISManager
Import-Module -Name Hosts
if (!(Test-IISMSite -Name $site)) {
"Adding $site with source folder C:\Domains\$name..."
New-IISMSite $site DefaultAppPool C:\Domains\$name
"Adding Site Binding $site http 80 127.0.0.1"
Add-IISMSiteBinding $site http 80 127.0.0.1 $site
}
"Adding $site to local host file..."
New-HostnameMapping $site 127.0.0.1
Start-IISMSite $site
"Running WSConfig on all sites..."
C:/ColdFusion2018/cfusion/runtime/bin/wsconfig.exe -ws iis -site 0 -v
"Running CFConfig for $site..."
box cfconfig import from=$config to=C:/ColdFusion2018/cfusion toformat=adobe@2018
"Restarting ColdFusion 2018 Application Server..."
Restart-Service -Name "ColdFusion 2018 Application Server" -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment