Skip to content

Instantly share code, notes, and snippets.

@riezebosch
Last active May 1, 2017 09:49
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 riezebosch/d764ce9414599a75ecd8 to your computer and use it in GitHub Desktop.
Save riezebosch/d764ce9414599a75ecd8 to your computer and use it in GitHub Desktop.
BoxStarter on Windows Server 2012 R2
# Tested on: http://care.dlservice.microsoft.com/dl/download/5/8/1/58147EF7-5E3C-4107-B7FE-F296B05F435F/9600.16415.amd64fre.winblue_refresh.130928-2229_server_serverdatacentereval_en-us.vhd
$myfeed = "https://myget.org/F/riezebosch/api/v2"
$wu = Get-Service -Name wuauserv
$wu | Set-Service -StartupType Manual
$wu | Start-Service
cinst DotNet3.5 -y --version 3.5.20140403
cinst powershell -y
$wu | Stop-Service
if (Test-PendingReboot) { Invoke-Reboot }
cinst MsSqlServer2014Express -y
if (Test-PendingReboot) { Invoke-Reboot }
cinst MsSqlServerManagementStudio2014Express -y
if (Test-PendingReboot) { Invoke-Reboot }
cinst googlechrome -y
cinst 7zip -y
cinst sumatrapdf.install -y
#Enable Web Services
cinst IIS-WebServerRole -source WindowsFeatures
cinst IIS-ISAPIFilter -source WindowsFeatures
cinst IIS-ISAPIExtensions -source WindowsFeatures
#Enable ASP.NET on win 2012/8
cinst IIS-NetFxExtensibility45 -source WindowsFeatures
cinst NetFx4Extended-ASPNET45 -source WindowsFeatures
cinst IIS-ASPNet45 -source WindowsFeatures
cinst WCF-Services45 -source WindowsFeatures
#Enable WCF in IIS
cinst WCF-HTTP-Activation -source WindowsFeatures
cinst WCF-NonHTTP-Activation -source WindowsFeatures
cinst WCF-HTTP-Activation45 -source WindowsFeatures
cinst WCF-TCP-Activation45 -source WindowsFeatures
cinst WCF-Pipe-Activation45 -source WindowsFeatures
cinst WCF-MSMQ-Activation45 -source WindowsFeatures
cinst WCF-TCP-PortSharing45 -source WindowsFeatures
cinst WCF-HTTP-Activation45 -source WindowsFeatures
cinst WordViewer -y
cinst PowerPointViewer -y
cinst FileFormatConverters -y
cinst skillpipereader -y
if (Test-PendingReboot) { Invoke-Reboot }
cinst MsSqlServerSchoolSampleDatabase -y --source $myfeed
cinst ILSpy -y
choco install git -y
setx PATH "$env:Path;$env:ProgramFiles\git\cmd"
choco install poshgit -y
choco install git-credential-manager-for-windows -y
$wu | Start-Service
#KB2919442, Required for KB2919355
Install-WindowsUpdate -Criteria "UpdateID='d851a023-f6c2-42ba-a4a2-36e5260925d0' AND IsInstalled=0"
#KB2919355, Required for VS2015
Install-WindowsUpdate -Criteria "UpdateID='8452bac0-bf53-4fbd-915d-499de08c338b' AND IsInstalled=0"
$wu | Stop-Service
choco install VisualStudio2015Enterprise -ia "/InstallSelectableItems WebTools;SQL" -y -source $myfeed -i
if (Test-PendingReboot) { Invoke-Reboot }
Set-WindowsExplorerOptions -EnableShowFileExtensions
Disable-InternetExplorerESC
# http://support.microsoft.com/kb/328010
# New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name WindowsUpdate
# New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AU
# New-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoUpdate -Value 1
# Invoke from task not recognized, direct uninstall hangs.
# Invoke-FromTask "Get-WindowsFeature | Where-Object {$_.Installed -match `"False`"} | Uninstall-WindowsFeature -Remove" -IdleTimeout 30
# Clear the temp excluding the boxstarter && chocolatey folders
Get-ChildItem -Path $env:TEMP -recurse |
Select -ExpandProperty FullName |
Where { $_ -notlike "*boxstarter*" -and $_ -notlike "*chocolatey*" } |
sort Length -Descending |
Remove-Item -Force
# http://serverfault.com/a/633255/311631
$cs = gwmi Win32_ComputerSystem
if ($cs.AutomaticManagedPagefile) {
$cs.AutomaticManagedPagefile = $False
$cs.Put()
}
$pg = gwmi win32_pagefilesetting
if ($pg) {
$pg.Delete()
}
if (Test-PendingReboot) { Invoke-Reboot }
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" -ErrorAction SilentlyContinue
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe" -ErrorAction SilentlyContinue
Install-ChocolateyPinnedTaskBarItem "$($env:windir)\system32\inetsrv\InetMgr.exe" -ErrorAction SilentlyContinue
$ilspy = gci -Path "$env:ChocolateyInstall\lib\ILSpy*\tools\ILSpy.exe" | select -ExpandProperty FullName
Install-ChocolateyPinnedTaskBarItem $ilspy -ErrorAction SilentlyContinue
# Set the last used template on the New Project dialog in VS to the C# node
New-Item -Path HKCU:\Software\Microsoft\VisualStudio\14.0 -Name NewProjectDialog -ea SilentlyContinue
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\14.0\NewProjectDialog -Name LastUsedTemplateNameProject -Value "Console Application"
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\14.0\NewProjectDialog -Name LastUsedTemplateNodeProject -Value "Templates\Visual C#"
# Tested on: http://care.dlservice.microsoft.com/dl/download/5/8/1/58147EF7-5E3C-4107-B7FE-F296B05F435F/9600.16415.amd64fre.winblue_refresh.130928-2229_server_serverdatacentereval_en-us.vhd
$myfeed = "https://myget.org/F/riezebosch/api/v2"
# Set mounted chocolaty cache to K:
Get-Partition -DriveLetter D -ea SilentlyContinue | Set-Partition -NewDriveLetter K
choco config set cacheLocation "K:\"
$myfeed = "https://myget.org/F/riezebosch"
$wu = Get-Service -Name wuauserv
$wu | Set-Service -StartupType Manual
$wu | Start-Service
choco install DotNet3.5 -y --version 3.5.20140403
choco install powershell -y --ignore-checksums
$wu | Stop-Service
choco install visualstudiocode -y
choco install vcredist2013 -y
choco install sql-server-express -y
choco install sql-server-management-studio -y
choco install MsSqlServerSchoolSampleDatabase -y --source $myfeed
choco install googlechrome -y
choco install 7zip -y
choco install sumatrapdf.install -y --ignore-checksums
choco install ILSpy -y
choco install git -y
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
cinst WordViewer -y
cinst PowerPointViewer -y
cinst FileFormatConverters -y
Set-WindowsExplorerOptions -EnableShowFileExtensions
Disable-InternetExplorerESC
$wu | Start-Service
#KB2919442, Required for KB2919355
Install-WindowsUpdate -Criteria "UpdateID='d851a023-f6c2-42ba-a4a2-36e5260925d0' AND IsInstalled=0"
#KB2919355, Required for VS2015
Install-WindowsUpdate -Criteria "UpdateID='8452bac0-bf53-4fbd-915d-499de08c338b' AND IsInstalled=0"
$wu | Stop-Service
choco install visualstudio2017-offline -ia -i "--add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.Azure" -y
# http://support.microsoft.com/kb/328010
# New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name WindowsUpdate
# New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AU
# New-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoUpdate -Value 1
# Invoke from task not recognized, direct uninstall hangs.
# Invoke-FromTask "Get-WindowsFeature | Where-Object {$_.Installed -match `"False`"} | Uninstall-WindowsFeature -Remove" -IdleTimeout 30
# http://serverfault.com/a/633255/311631
$cs = gwmi Win32_ComputerSystem
if ($cs.AutomaticManagedPagefile) {
$cs.AutomaticManagedPagefile = $False
$cs.Put()
}
$pg = gwmi win32_pagefilesetting
if ($pg) {
$pg.Delete()
}
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe" -ErrorAction SilentlyContinue
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft VS Code\Code.exe" -ErrorAction SilentlyContinue
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe" -ErrorAction SilentlyContinue
$ilspy = gci -Path "$env:ChocolateyInstall\lib\ILSpy*\tools\ILSpy.exe" | select -ExpandProperty FullName
Install-ChocolateyPinnedTaskBarItem $ilspy -ErrorAction SilentlyContinue
choco config set cacheLocation ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment