Skip to content

Instantly share code, notes, and snippets.

@JohnLBevan
Last active February 27, 2021 21:06
Show Gist options
  • Save JohnLBevan/d30c641a17d5fae548a0 to your computer and use it in GitHub Desktop.
Save JohnLBevan/d30c641a17d5fae548a0 to your computer and use it in GitHub Desktop.
Standard build script for an app services test server; ensures the required debugging toolset's available.
#to install chocolatey, powershell 4 & boxstarter then run this script:
#iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
#choco install powershell
#(restart computer)
#choco install boxstarter
#(restart computer)
#start http://boxstarter.org/package/url?
#above line plus raw url: e.g. https://gist.githubusercontent.com/JohnLBevan/d30c641a17d5fae548a0/raw/4c3737001f3afece1d29162f7004d665ecea667d/TestServerStandardBuild.ps1
#script options
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
#end script options
#basic config
Update-ExecutionPolicy Unrestricted
#Set-ExplorerOptions -showProtectedOSFiles -showFileExtensions -showHidenFilesFoldersDrives #spelling mistake in hiden intentional; https://boxstarter.codeplex.com/wikipage?title=Set-ExplorerOptions
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
#Enable-RemoteDesktop
Disable-InternetExplorerESC
Disable-UAC
#Set-TaskbarSmall
Set-TaskbarOptions -Size Small -Lock -Dock Bottom
#end basic config
#windows updates
Install-WindowsUpdate -AcceptEula
#end windows updates
#.net frameworks
cinst DotNet3.5 -y #includes 2.0 & 3.0
cinst DotNet4.5.1 -y #includes 4.0 and 4.5
#end .net frameworks
#boxstarter
#these components are installed temporarily anyway, but installing them here ensures we don't need to download temp packages each time
#cinst powershell -y #get the latest version of powershell (4.0 at time of writing)
#cinst chocolatey -y #needs to be installed first; otherwise doesn't play well
#cinst boxstarter -y #needs to be installed first; otherwise doesn't play well
#end boxstarter
#utils
cinst programmersnotepad -y #my text editor of choice (many prefer: notepadplusplus)
cinst 7zip -y #7-zip compression
cinst ransack -y #MythicSoft's Agent Ransack; advanced file search
cinst sysinternals -y #MS sysinternals utils
cinst procexp -y #process explorer
cinst windirstat -y #disk space aid
cinst winmerge -y #file comparison
cinst adobereader -y #pdf reader
cinst vcredist2010 -y #c++ 2010 redist (required for EAM)
cinst newrelicserver -y -ia NRLicenseKey=20b744dd6df2706ca1dd4f4751e59742f4141750
#end utils
#create file associations
Install-ChocolateyFileAssociation ".txt" "$($Boxstarter.programFiles86)\Programmer's Notepad\pn.exe"
Install-ChocolateyFileAssociation ".log" "$($Boxstarter.programFiles86)\Programmer's Notepad\pn.exe"
Install-ChocolateyFileAssociation ".xml" "$($Boxstarter.programFiles86)\Programmer's Notepad\pn.exe"
Install-ChocolateyFileAssociation ".config" "$($Boxstarter.programFiles86)\Programmer's Notepad\pn.exe"
#end create file associations
#windows updates (again, just in case anything above means there's new updates which we've not yet restarted for)
Install-WindowsUpdate -AcceptEula
#end windows updates
#done
if (Test-PendingReboot) { Invoke-Reboot }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment