Skip to content

Instantly share code, notes, and snippets.

@JEStaubach
Last active March 20, 2017 06:10
Show Gist options
  • Save JEStaubach/8357aa6c1ff31b271c6cba01afcfab19 to your computer and use it in GitHub Desktop.
Save JEStaubach/8357aa6c1ff31b271c6cba01afcfab19 to your computer and use it in GitHub Desktop.
#START http://boxstarter.org/package/url?https://gist.githubusercontent.com/JEStaubach/8357aa6c1ff31b271c6cba01afcfab19/raw
# Initialize reboot log file
$reboot_log = "C:\installation.rbt"
if ( -not (Test-Path $reboot_log) ) { New-Item $reboot_log -type file }
$reboots = Get-Content $reboot_log
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Enable-RemoteDesktop
Set-TaskbarOptions -Size Large -Lock -Dock Left #Small
if (Test-PendingReboot) { Invoke-Reboot }
# Update Windows and reboot if necessary
$section = "WindowsUpdate"
try {
#Give it a few minutes, may be working on another update?
if ( -not ($section -in $reboots) ) { start-sleep -s 180 }
Install-WindowsUpdate -AcceptEula
}
catch {
# Try one more reboot...
$section = "0x80240016Error"
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
}
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Install Choocolatey Tools
$section = "ChocolateyTools"
choco install chocolatey
choco install boxstarter
# Choco dev tools
$section = "ChocoDevTools1"
choco install vcredist2005 --ignore-checksums
choco install vcredist2008 --ignore-checksums
choco install vcredist2010 --ignore-checksums
choco install vcredist2012 --ignore-checksums
choco install vcredist2013 --ignore-checksums
choco install vcredist2015 --ignore-checksums
choco install vagrant --ignore-checksums
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
$section = "ChocoDevTools2"
choco install virtualbox --ignore-checksums
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Essentials
$section = "Essentials"
choco install notepadplusplus
choco install 7zip
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Webstuff
$section = "Webstuff"
choco install googlechrome --ignore-checksums
choco install firefox --ignore-checksums
choco install curl
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Open Source Dev
$section = "DotNet"
choco install dotnet4.5
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
$section = "OSDev"
choco install autohotkey.portable --ignore-checksums
#choco install github --ignore-checksums #Package broken - hangs install git instead
choco install git -params '"/GitAndUnixToolsOnPath /NoAutoCrlf"'
choco install sourcetree --ignore-checksums
choco install teamviewer
choco install winmerge --ignore-checksums
if (Test-PendingReboot) { Invoke-Reboot }
# Automation
$section = "Automation"
#choco install autohotkey --ignore-checksums #dependency of github so moving up
choco install autoit --ignore-checksums
if (Test-PendingReboot) { Invoke-Reboot }
# Admin Tools
$section = "AdminTools"
choco install putty --ignore-checksums
choco install wireshark --ignore-checksums
choco install filezilla --ignore-checksums
choco install winscp --ignore-checksums
if (Test-PendingReboot) { Invoke-Reboot }
# PS Tools
$section = "PSTools"
choco install pester
#choco install poshgit #Claims to be included with github
if (Test-PendingReboot) { Invoke-Reboot }
# Misc dev tools
$section = "MiscDevTolls"
#choco install fiddler
#choco install mingw
#choco isntall cmake
if (Test-PendingReboot) { Invoke-Reboot }
# Misc Apps
$section = "MiscApps"
choco install adobereader --ignore-checksums
choco install javaruntime --ignore-checksums
#choco install sdelete # should be in sysinternals
choco install imagemagick
choco install pdfcreator --ignore-checksums
choco install cdburnerxp --ignore-checksums
choco install sysinternals
#choco install NugetPackageExplorer
#choco install sharpkeys
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Install Visual Studio 2015 Community
$section = "VisualStudio2015"
choco install visualstudio2015community --ignore-checksums -packageParameters '--AdminFile https://gist.githubusercontent.com/JEStaubach/ba011fb86ab0b0009cc006a3732e89f8/raw'
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Install Pythons
$section = "Python"
$preserve_path = Get-Item env:\Path
choco install python.pypy -y
choco install ironpython -y
choco install python2 -moy --version 2.7.11 --install-arguments '/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python27'
choco install python2-x86_32 -moy --version 2.7.11 --install-arguments '/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python27_32'
choco install python3 -moy --version 3.3.5 --install-arguments '/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python33'
choco install python3 -moy --version 3.4.3.20150501 --install-arguments '/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python34'
choco install python3-x86_32 -moy --version 3.4.3.20150501 --install-arguments '/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python34_32'
choco install python3 -moy --version 3.5.2 --install-arguments '/Quiet InstallAllUsers=1 PrependPath=1 TargetDir=C:\Python35'
choco install python3-x86_32 -moy --version 3.5.2 --install-arguments '/Quiet InstallAllUsers=1 PrependPath=1 TargetDir=C:\Python35'
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Install pypi packages
$section = "pip"
choco upgrade pip -s Python -y
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
$section = "PypiPackages"
choco install virtualenv -s Python
# Productivity
#$section = "Productivity"
#choco install office365proplus
#if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
# Docker
$section = "Docker"
choco install Microsoft-Hyper-V-All -source windowsFeatures
choco install containers -source windowsFeatures
choco install docker -y
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
#SQL Server Express
#choco install mssqlserver2014express
#choco install mssqlservermanagementstudio2014express
# VS extensions
$section = "VS Extensions"
function ignore_checksums($pkgName, $pkgUrl) {
Write-Host "Ignore Checksums: Installing $($pkgName) from $($pkgUrl)."
set-item env:\ChocolateyAllowEmptyChecksums 'true'
set-item env:\ChocolateyAllowEmptyChecksumsSecure 'true'
install-ChocolateyVsixPackage -PackageName $pkgName -VsixUrl $pkgUrl
}
ignore_checksums 'Web Essentials 2015.3' 'https://visualstudiogallery.msdn.microsoft.com/ee6e6d8c-c837-41fb-886a-6b50ae2d06a2/file/146119/48/Web%20Essentials%202015.3%20v3.0.235.vsix'
ignore_checksums 'Bundler & Minifier' 'https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40/file/164487/35/Bundler%20%26%20Minifier%20v2.1.279.vsix'
ignore_checksums 'Web Compiler' 'https://visualstudiogallery.msdn.microsoft.com/3b329021-cd7a-4a01-86fc-714c2d05bb6c/file/164873/41/Web%20Compiler%20v1.11.319.vsix'
ignore_checksums 'Image Optimizer' 'https://visualstudiogallery.msdn.microsoft.com/a56eddd3-d79b-48ac-8c8f-2db06ade77c3/file/38601/44/Image%20Optimizer%20v3.6.94.vsix'
ignore_checksums 'Web Analyzer' 'https://visualstudiogallery.msdn.microsoft.com/6edc26d4-47d8-4987-82ee-7c820d79be1d/file/181923/24/Web%20Analyzer%20v1.7.77.vsix'
ignore_checksums 'Gulp Snippet Pack' 'https://visualstudiogallery.msdn.microsoft.com/9e26d1f9-1baf-4983-8c25-f5f769998d4f/file/205735/3/Gulp%20Snippet%20Pack%20v1.2.5.vsix'
ignore_checksums 'Grunt Snippet Pack' 'https://visualstudiogallery.msdn.microsoft.com/e88222de-b491-4d15-abf5-db4326200e78/file/207138/5/Grunt%20Snippet%20Pack%20v1.1.6.vsix'
ignore_checksums 'Editor Enhancements' 'https://visualstudiogallery.msdn.microsoft.com/4f64e542-3772-4136-8f87-0113441c7aa1/file/211002/12/Editor%20Enhancements%20v1.0.24.vsix'
ignore_checksums 'Image Sprites' 'https://visualstudiogallery.msdn.microsoft.com/8bb845e9-5717-4eae-aed3-1fdf6fe5819a/file/213972/13/Image%20Sprites%20v1.4.45.vsix'
ignore_checksums 'Markdown Editor' 'https://visualstudiogallery.msdn.microsoft.com/eaab33c3-437b-4918-8354-872dfe5d1bfe/file/216970/22/Markdown%20Editor%20v1.9.173.vsix'
ignore_checksums 'File Icons' 'https://visualstudiogallery.msdn.microsoft.com/5e1762e8-a88b-417c-8467-6a65d771cc4e/file/224554/13/File%20Icons%20v1.7.61.vsix'
ignore_checksums 'StopOnFirstBuildError' 'https://visualstudiogallery.msdn.microsoft.com/91aaa139-5d3c-43a7-b39f-369196a84fa5/file/44205/7/StopOnFirstBuildError.vsix'
ignore_checksums 'GitHub Extension for Visual Studio' 'https://visualstudiogallery.msdn.microsoft.com/75be44fb-0794-4391-8865-c3279527e97d/file/159055/25/GitHub.VisualStudio.vsix'
ignore_checksums 'GitFlow for Visual Studio 2015' 'https://visualstudiogallery.msdn.microsoft.com/f5ae0a1d-005f-4a09-a19c-3f46ff30400a/file/154275/11/GitFlowVS.2015.vsix'
ignore_checksums 'PowerShell Tools for Visual Studio 2015' 'https://visualstudiogallery.msdn.microsoft.com/c9eb3ba8-0c59-4944-9a62-6eee37294597/file/199313/3/PowerShellTools.14.0.vsix'
ignore_checksums 'VSColorOutput' 'https://visualstudiogallery.msdn.microsoft.com/f4d9c2b5-d6d7-4543-a7a5-2d7ebabc2496/file/63103/18/VSColorOutput.vsix'
ignore_checksums 'SideWaffle Template Pack' 'https://visualstudiogallery.msdn.microsoft.com/a16c2d07-b2e1-4a25-87d9-194f04e7a698/referral/110630'
ignore_checksums 'Ref12' 'https://visualstudiogallery.msdn.microsoft.com/f89b27c5-7d7b-4059-adde-7ccc709fa86e/file/125016/13/Ref12.vsix'
ignore_checksums 'Add New File' 'https://visualstudiogallery.msdn.microsoft.com/3f820e99-6c0d-41db-aa74-a18d9623b1f3/file/140782/44/Add%20New%20File%20v3.5.113.vsix'
ignore_checksums 'NuGet Reference Switcher' 'https://visualstudiogallery.msdn.microsoft.com/e2458c0b-03c0-47a9-a94b-0d28567e0a84/file/159417/6/NuGetReferenceSwitcher.vsix'
ignore_checksums 'AutoHistory' 'https://visualstudiogallery.msdn.microsoft.com/dfcb2438-180c-4f8a-983b-62d89e141fe3/file/122993/3/Microsoft.VisualStudio.AutoHistory.vsix'
ignore_checksums 'File Nesting' 'https://visualstudiogallery.msdn.microsoft.com/3ebde8fb-26d8-4374-a0eb-1e4e2665070c/file/123284/33/File%20Nesting%20v2.5.63.vsix'
ignore_checksums 'Error Catcher' 'https://visualstudiogallery.msdn.microsoft.com/a85f155f-b519-44a8-b56b-07611cf78393/file/136589/19/Error%20Catcher%20v1.8.42.vsix'
ignore_checksums 'SlowCheetah - XML Transforms Preview for 2015' 'https://visualstudiogallery.msdn.microsoft.com/05bb50e3-c971-4613-9379-acae2cfe6f9e/file/171400/1/SlowCheetah.vsix'
ignore_checksums 'CssCop - FxCop for Stylesheets' 'https://visualstudiogallery.msdn.microsoft.com/a921b98e-9430-4be2-bf53-1169e12bdb50/file/62099/7/CssLint.vsix'
ignore_checksums 'Open From Azure Websites' 'https://visualstudiogallery.msdn.microsoft.com/60d414b1-4ead-4fde-9359-588aa126cd6c/file/151097/8/Open%20From%20Azure%20Websites%20v1.2.44.vsix'
ignore_checksums 'Node.js Tools 1.2 for Visual Studio 2015' 'https://visualstudiogallery.msdn.microsoft.com/68faf8ac-b953-42f5-a908-55555deccf7a/file/206630/5/NTVS%201.2%20VS%202015.msi'
ignore_checksums 'Trailing Whitespace Visualizer' 'https://visualstudiogallery.msdn.microsoft.com/a204e29b-1778-4dae-affd-209bea658a59/file/135653/32/Trailing%20Whitespace%20Visualizer%20v2.5.80.vsix'
ignore_checksums 'MVVM Light for VS2015' 'https://visualstudiogallery.msdn.microsoft.com/ee36692d-ed3f-4888-b904-281aaaeac529/file/177721/1/MvvmLight.VS2015.vsix'
ignore_checksums 'Open Command Line' 'https://visualstudiogallery.msdn.microsoft.com/4e84e2cf-2d6b-472a-b1e2-b84932511379/file/151803/40/Open%20Command%20Line%20v2.1.176.vsix'
ignore_checksums 'YAML Editor' 'https://visualstudiogallery.msdn.microsoft.com/34423c06-f756-4721-8394-bc3d23b91ca7/file/101669/11/YamlDotNetEditor.vsix'
ignore_checksums 'Suggested Extensions' 'https://visualstudiogallery.msdn.microsoft.com/3be88243-8bf1-407a-a7ca-a968d0de2d59/file/176854/24/Suggested%20Extensions%20v1.1.76.vsix'
ignore_checksums 'Flatten Packages' 'https://visualstudiogallery.msdn.microsoft.com/cd0b1938-4513-4e57-b9b7-c674b4a20e79/file/157954/10/Flatten%20Packages%20v1.1.14.vsix'
ignore_checksums 'Developer Assistant' 'https://visualstudiogallery.msdn.microsoft.com/5d01e3bd-6433-47f2-9c6d-a9da52d172cc/file/150980/11/DeveloperAssistant_2015.vsix'
ignore_checksums 'EditorConfig' 'https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328/file/75539/12/EditorConfigPlugin.vsix'
ignore_checksums 'Package Installer' 'https://visualstudiogallery.msdn.microsoft.com/753b9720-1638-4f9a-ad8d-2c45a410fd74/file/173807/28/Package%20Installer%20v1.8.87.vsix'
ignore_checksums 'JavaScript Snippet Pack' 'https://visualstudiogallery.msdn.microsoft.com/423eb4a3-215f-4a8f-9287-1512618ffda3/file/196680/10/JavaScript%20Snippet%20Pack%20v1.2.14.vsix'
ignore_checksums 'HTML Snippet Pack' 'https://visualstudiogallery.msdn.microsoft.com/57a8ac31-775a-428c-ade9-6837d183a4dc/file/223487/5/HTML%20Snippet%20Pack%20v1.0.5.vsix'
ignore_checksums 'Syntax Highlighting Pack' 'https://visualstudiogallery.msdn.microsoft.com/d92fd742-bab3-4314-b866-50b871d679ee/file/225232/16/Syntax%20Highlighting%20Pack%20v1.6.46.vsix'
ignore_checksums 'React Snippet Pack' 'https://visualstudiogallery.msdn.microsoft.com/234d79e9-f0fd-41e1-a926-850da8e8c7d7/file/157930/12/React%20Snippet%20Pack%20v1.3.19.vsix'
ignore_checksums 'File Differ' 'https://visualstudiogallery.msdn.microsoft.com/9b4f1f00-492d-48bc-8857-702332217b67/file/207557/5/File%20Differ%20v1.4.20.vsix'
ignore_checksums 'Learn the Shortcut' 'https://visualstudiogallery.msdn.microsoft.com/29f07f2c-68aa-47fa-b1c3-48065209b110/file/209024/14/Learn%20the%20Shortcut%20v1.4.27.vsix'
ignore_checksums 'Productivity Power Tools 2015' 'https://visualstudiogallery.msdn.microsoft.com/34ebc6a2-2777-421d-8914-e29c1dfa7f5d/file/169971/3/ProPowerTools.vsix'
ignore_checksums 'T4 Toolbox for Visual Studio 2015' 'https://visualstudiogallery.msdn.microsoft.com/34b6d489-afbc-4d7b-82c3-dded2b726dbc/file/165481/4/T4Toolbox.14.0.0.76.vsix'
ignore_checksums 'SpecFlow for Visual Studio 2015' 'https://visualstudiogallery.msdn.microsoft.com/c74211e7-cb6e-4dfa-855d-df0ad4a37dd6/file/160542/7/TechTalk.SpecFlow.Vs2015Integration.v2015.1.2.vsix'
ignore_checksums 'AWS Toolkit for Visual Studio' 'https://visualstudiogallery.msdn.microsoft.com/175787af-a563-4306-957b-686b4ee9b497/referral/57587'
if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
#$section = "Server Mgmt"
#cinst IIS-WebServerRole -source windowsfeatures
#cinst IIS-HttpCompressionDynamic -source windowsfeatures
#cinst IIS-ManagementScriptingTools -source windowsfeatures
#cinst IIS-WindowsAuthentication -source windowsfeatures
#if ( -not ($section -in $reboots) ) { Add-Content $reboot_log $section ; Invoke-Reboot }
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Google\Chrome\Application\chrome.exe"
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"
Install-ChocolateyPinnedTaskBarItem "$($env:windir)\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe"
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Notepad++\notepad++.exe"
nuget install htmlagilitypack -OutputDirectory c:\tools
#Cleanup the disk
# Remove update un-installers
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
# Clean the disk
C:\Windows\System32\cleanmgr.exe /d c:
#Defrag
Optimize-Volume -DriveLetter C
#sdelete -> fill empty with 0
sdelete.exe -z c:
# Cleanup reboot log temp file
Remove-Item $reboot_log -Force
#This box starter script/configuration is adapted from:
#https://gist.githubusercontent.com/benoit74/7d98ed4b958804cac4d8/raw/3195b11b6e533a0df33b950d706ec15e30f38805/BoxStarter-DEV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment