Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProNotion/c0b80509888a300d1fd6aa29ec1a0e50 to your computer and use it in GitHub Desktop.
Save ProNotion/c0b80509888a300d1fd6aa29ec1a0e50 to your computer and use it in GitHub Desktop.
Personal dev boxstarter scripts
######## Phil's dev VM boxstarter script ########
###############
#### NOTES ####
###############
## After a restart/reconnect, even though it shows the login screen, boxstarter is still working
### NOTES when kicking off remotely from host to VM, fails on Configuring CredSSP settings
## check http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/30/understanding-powershell-remote-management.aspx
### MISC NOTES
## Boxstarter repeats the _entire_ script after restart. For already-installed packages, Chocolatey will take a couple seconds each to verify. This can get tedious, so consider putting packages that require a reboot near the beginning of the script.
## Boxstarter automatically disables windows update so you don't need to do that at the beginning of the script.
## you still want to Restart or Update and Restart afterwards - and to ensure UAC is enabled
### STATISTICS
## took 1:20 hours on an Azure VM with SSD
## required 4 reboots
## VS 2017 with 2 workloads took 28:23 minutes
## 6 Windows updates took 19:01 minutes
### HACK Workaround choco / boxstarter path too long error
## https://github.com/chocolatey/boxstarter/issues/241
$ChocoCachePath = "$env:USERPROFILE\AppData\Local\Temp\chocolatey"
New-Item -Path $ChocoCachePath -ItemType Directory -Force
######################################
#### make sure we're not bothered ####
######################################
Disable-UAC
######################
#### dependencies ####
######################
## NOTE none right now
#########################
#### requires reboot ####
#########################
choco upgrade --cacheLocation="$ChocoCachePath" google-chrome-x64
choco upgrade --cacheLocation="$ChocoCachePath" visualstudio2017enterprise
choco upgrade --cacheLocation="$ChocoCachePath" visualstudio2017-workload-netweb
choco upgrade --cacheLocation="$ChocoCachePath" visualstudio2017-workload-azure
#######################
#### general utils ####
#######################
choco upgrade --cacheLocation="$ChocoCachePath" brave
choco upgrade --cacheLocation="$ChocoCachePath" 7zip.install
choco upgrade --cacheLocation="$ChocoCachePath" filezilla
choco upgrade --cacheLocation="$ChocoCachePath" Recuva
choco upgrade --cacheLocation="$ChocoCachePath" sysinternals
## NOTE: by default, installs to C:\tools\sysinternals
choco upgrade --cacheLocation="$ChocoCachePath" windirstat
choco upgrade --cacheLocation="$ChocoCachePath" lockhunter
## NOTE: opens webpage after install
######################
#### general apps ####
######################
choco upgrade --cacheLocation="$ChocoCachePath" SublimeText3
choco upgrade --cacheLocation="$ChocoCachePath" keepass.install
choco upgrade --cacheLocation="$ChocoCachePath" teracopy
###################
#### dev utils ####
###################
choco upgrade --cacheLocation="$ChocoCachePath" fiddler
choco upgrade --cacheLocation="$ChocoCachePath" winmerge
choco upgrade --cacheLocation="$ChocoCachePath" postman
##################
#### dev apps ####
##################
choco upgrade --cacheLocation="$ChocoCachePath" resharper-ultimate-all
choco upgrade --cacheLocation="$ChocoCachePath" sql-server-management-studio
#################################
#### NOW get windows updates ####
#################################
Enable-MicrosoftUpdate
Install-WindowsUpdate -AcceptEula
#################
#### cleanup ####
#################
del C:\eula*.txt
del C:\install.*
del C:\vcredist.*
del C:\vc_red.*
###############################
#### windows configuration ####
###############################
## NOTE do these here so that it only happens once (shouldn't reboot any more at this point)
Enable-RemoteDesktop
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles
TZUTIL /s "Eastern Standard Time"
Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe"
Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles}\Sublime Text 3\sublime_text.exe"
Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe"
Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles(x86)}\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe"
################################
#### restore disabled stuff ####
################################
Enable-UAC
## TODO figure out how to force a single restart here, but only once (not every time the script runs)
#########################
#### manual installs ####
#########################
## NOTE none right now
###########################
#### optional installs ####
###########################
### general utils
# choco upgrade imgburn
# choco upgrade bulkrenameutility
# choco upgrade mpc-hc
# choco upgrade markdownpad2
# choco upgrade dropbox
## NOTE causes reboot
## NOTE opens UI after restart
### general apps
# choco upgrade Kindle
# choco upgrade skype
# choco upgrade foxitreader
### dev utils
# choco upgrade ilmerge
# choco upgrade ilspy
### sql server
# choco upgrade sql-server-express
$cred=Get-Credential MicrosoftAccount\{your_ms_account_here}
Install-BoxstarterPackage -PackageName {public_location_of_your_boxstarter_install_script} -Credential $cred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment