Created
March 20, 2015 06:19
-
-
Save sheastrickland/f83bab270e4915ec50e3 to your computer and use it in GitHub Desktop.
Application Initialization config for deployments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load IIS module: | |
Import-Module WebAdministration | |
# Set a name of the site we want to change | |
$webSiteName = $OctopusParameters['OctopusWebSiteName'] | |
# Get web site object | |
$webSite = Get-Item "IIS:\Sites\$webSiteName" | |
Write-Output "Setting IIS web site $webSiteName serverAutoStart to true" | |
$webSite.serverAutoStart="true" | |
$webSite | Set-Item | |
Write-Output "Setting IIS web site $webSiteName root application preloadEnabled to true" | |
Set-WebConfigurationProperty "/system.applicationHost/sites/site[@name='$webSiteName']/application" -Name "preloadEnabled" -Value "true" -PSPath IIS:\ | |
# Set a name of the appPool we want to change | |
$applicationPoolName = $OctopusParameters['OctopusAppPoolName'] | |
Write-Output "Setting IIS AppPool $applicationPoolName autoStart to true and startMode to AlwaysRunning." | |
$pool = Get-Item IIS:\AppPools\"$applicationPoolName" | |
$pool.autoStart="true" | |
$pool.startMode="AlwaysRunning" | |
$pool | Set-Item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment