Skip to content

Instantly share code, notes, and snippets.

@timcunningham
Last active January 15, 2020 14:39
Show Gist options
  • Save timcunningham/b958a60dca1b454e8a9c40854761a22d to your computer and use it in GitHub Desktop.
Save timcunningham/b958a60dca1b454e8a9c40854761a22d to your computer and use it in GitHub Desktop.
cfdevBoxStarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Modified: Tim Cunningham <timcunningham71@gmail.com>
# Last Updated: 2020-01-02
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
#
# Learn more: http://boxstarter.org/Learn/WebLauncher
#---- TEMPORARY ---
Disable-UAC
#--- Set Time Zone ---
Set-TimeZone -Name "Eastern Standard Time" -Verbose
#--- Fonts ---
choco install inconsolata -y
#--- Tools ---
choco install sysinternals -y
#--- Apps ---
choco install git -params '"/GitAndUnixToolsOnPath"'
choco install googlechrome -y
choco upgrade conemu -y
choco install notepadplusplus -y
choco install postman
choco install winmerge
choco install vscode -y
choco install vscode-powershell -y
choco install putty
choco install jre8 -y
choco install commandbox -y
#choco install avastfreeantivirus -y
choco install curl -y
choco install wget -y
choco install nuget.commandline -y
choco install nugetpackagemanager -y
#--- Windows Settings ---
Disable-GameBarTips
Enable-PSRemoting -SkipNetworkProfileCheck -Force
Update-Help
# Download PTS Setup Scripts
"Download createPTSIISite.ps1"
wget -O C:\vagrant\createPTSIISite.ps1 https://gist.github.com/timcunningham/49dead0f6dc2d0cb6b85bc74c11cdee1/raw
"Download clonePTS.ps1"
wget -O c:\vagrant\clonePTS.ps1 https://gist.github.com/timcunningham/8c5262164d04fbf2c0b876473b67acf6/raw
#--- Download windows preferences script and run forked from Disassembler0/Win10-Initial-Setup-Script ---
if(Test-Path "Win10-Initial-Setup-Script"){
Remove-Item -Recurse -Force Win10-Initial-Setup-Script
}
git clone https://github.com/timcunningham/Win10-Initial-Setup-Script.git
cd Win10-Initial-Setup-Script
.\Default.cmd
cd ..
Remove-Item -Recurse -Force Win10-Initial-Setup-Script
if (-not (Test-Path -Path 'C:\vagrant\installers') ) {
mkdir c:\vagrant\installers
}
#--- Download and install ColdFusion 2018 ---
$url = "http://174.77.8.65/cf2018.zip"
$output = "c:\vagrant\installers\cf2018.zip"
$start_time = Get-Date
if (-not (Test-Path -Path $output) ) {
Write-Output "Downloading ColdFusion 2018 (this could take a while) . . . "
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
}
else {
Write-Output "$output already exists skipping download."
}
Write-Output "Extract ColdFusion 2018 zip file . . . "
Expand-Archive -LiteralPath C:\vagrant\installers\cf2018.zip -DestinationPath C:\vagrant\installers\cf2018 -force
Write-Output "Get Silent Install file "
wget -OutFile C:\vagrant\installers\cf2018\silent.properties https://gist.githubusercontent.com/timcunningham/f6c9cbf041b2d0208e0e19e9aac809a0/raw
$ServiceName = 'ColdFusion 2018 Application Server'
$arrService = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
if ($arrService.Length -eq 0) {
Write-Output "Install ColdFusion 2018 Silently . . . "
C:\vagrant\installers\cf2018\cf2018.exe -f C:\vagrant\installers\cf2018\silent.properties
}
else { "ColdFusion 2018 already installed. Skipping Install" }
While ($arrService.Length -eq 0) {
Write-Output 'ColdFusion service does not exist checking again in 30 seconds'
Start-Sleep -seconds 30
$arrService = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
}
While ($arrService.status -ne 'Running')
{
Write-Output $arrService.Name
Write-Output $arrService.Status
Write-Output 'ColdFusion service not running checking again in 15 seconds'
$arrService.Refresh()
Start-Sleep -seconds 15
}
Write-Output 'ColdFusion Service running'
#Run CF under the local user/pass vagrant/vagrant
"Set CF service to use local user/pass vagrant/vagrant"
$svc=Get-CimInstance win32_service -Filter 'Name="ColdFusion 2018 Application Server"'
$svc|Invoke-CimMethod -MethodName Change -Arguments @{StartName='.\vagrant';StartPassword='vagrant'}
"Restarting ColdFusion 2018 Application Server to apply service user..."
Restart-Service -Name "ColdFusion 2018 Application Server" -Force
#--- Install Commandbox module cfconfig ---
box install commandbox-cfconfig
box update --system
#--- Install IIS
#Set-ExecutionPolicy Bypass -Scope Process
# To list all Windows Features: dism /online /Get-Features
# Get-WindowsOptionalFeature -Online
# LIST All IIS FEATURES:
# Get-WindowsOptionalFeature -Online | where FeatureName -like 'IIS-*'
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment
Enable-WindowsOptionalFeature -online -FeatureName NetFx4Extended-ASPNET45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpLogging
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestMonitor
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Security
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestFiltering
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Performance
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools
Enable-WindowsOptionalFeature -Online -FeatureName IIS-IIS6ManagementCompatibility
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Metabase
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CGI
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET -all
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
#Install-WindowsFeature -name Web Server -IncludeManagementTools
# The following optional components require
# Chocolatey OR Web Platform Installer to install
choco install urlrewrite -y
# Install WebDeploy for Deploying to IIS (optional)
### & "C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd-x64.exe" /install /Products:WDeployNoSMO /AcceptEULA /SuppressPostFinish
# choco install webdeploy -y
# Disable Loopback Check on a Server - to get around no local Logins on Windows Server
# New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -Value "1" -PropertyType dword
#--- Get Windows Updates
Install-WindowsUpdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment