Skip to content

Instantly share code, notes, and snippets.

@kpietralik
Last active January 7, 2020 22:09
Show Gist options
  • Save kpietralik/8e690015146a064cac47578f0e0ef835 to your computer and use it in GitHub Desktop.
Save kpietralik/8e690015146a064cac47578f0e0ef835 to your computer and use it in GitHub Desktop.
Boxstarter and Chocolatey Script
#### Boxstarter and Chocolatey
## Restore AppData before running
## RUN AS ADMIN!
## choco install - install
## choco upgrade - install or upgrade
## cinst - install
## cinstm - install or upgrade
## Cmd run with reboot START http://boxstarter.org/package/url?C:\boxstarter.txt
## Cmd run without reboot START http://boxstarter.org/package/nr/url?C:\boxstarter.txt
## START http://boxstarter.org/package/url?https://gist.githubusercontent.com/Quass1m/8e690015146a064cac47578f0e0ef835/raw/084d6e12c1c908d125e7459e3188c080ac7cf83f/Boxstarter.txt
## DEV: https://rawgit.com/Quass1m/8e690015146a064cac47578f0e0ef835/raw/f0b0365ad7c134b9f7dc0e656750715468f1dd87/Boxstarter.txt
## PROD: https://cdn.rawgit.com/Quass1m/8e690015146a064cac47578f0e0ef835/raw/f0b0365ad7c134b9f7dc0e656750715468f1dd87/Boxstarter.txt
####
# Boxstarter options
$Boxstarter.RebootOk=$false
$Boxstarter.NoPassword=$true
$Boxstarter.AutoLogin=$true
# Update Windows
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
Install-WindowsUpdate -AcceptEula
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
Update-ExecutionPolicy Unrestricted
Update-Help
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Install IIS and its features
cinst NetFx3 -source windowsFeatures
cinst IIS-WebServerRole -source windowsfeatures
cinst TelnetClient -source windowsFeatures
cinst IIS-HttpCompressionDynamic -source windowsfeatures
cinst IIS-ManagementScriptingTools -source windowsfeatures
cinst IIS-WindowsAuthentication -source windowsfeatures
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Install system utilities
cinst PowerShell
cinst vcredist2010
cinst vcredist140
cinst dotnet3.5
cinst dotnet4.5
cinst dotnet4.6.2
cinst mono
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Modify explorer, taskbar, desktop, login
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -DisableShowRecentFilesInQuickAccess -DisableShowFrequentFoldersInQuickAccess -DisableExpandToOpenFolder
#Set-TaskbarOptions -Size Small
Set-CornerNavigationOptions -EnableUsePowerShellOnWinX
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Modify remoting and updates
Enable-RemoteDesktop
Enable-PSRemoting -Force -SkipNetworkProfileCheck
#Enable-MicrosoftUpdate
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Disable UAC and bloatware
Disable-UAC
Disable-InternetExplorerESC
Disable-GameBarTips
Disable-BingSearch
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Move library location
Move-LibraryDirectory "Personal" "D:\Personal"
Move-LibraryDirectory "My Pictures" "D:\Personal\Pictures"
Move-LibraryDirectory "My Video" "D:\Personal\Videos"
Move-LibraryDirectory "My Music" "D:\Music"
Move-LibraryDirectory "{374DE290-123F-4565-9164-39C4925E467B}" "D:\Downloads"
#Move-LibraryDirectory "{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}" "D:\Personal\Saved Games" # broken...
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Install applications
cinst chocolatey
cinst boxstarter
cinst wudt
cinst chocolatey-core.extension
cinst 7zip
cinst allow-block-remove-firewall
cinst autohotkey.portable
cinst calibre
cinst chocolateygui
cinst ccleaner
cinst cdburnerxp
cinst clink
cinst cpu-z
cinst dropbox
cinst dws.portable
cinst gpu-z
cinst hwinfo
cinst openhardwaremonitor
cinst coretemp
cinst crystaldiskinfo
cinst crystaldiskmark
cinst firefox
cinst foobar2000
cinst googlechrome
cinst googledrive
cinst greenshot
cinst irfanview
cinst jdk8
cinst jre8
cinst jdk9
cinst jre9
cinst k-litecodecpackfull
cinst keepass
cinst lockhunter
cinst notepadplusplus
cinst glogg
cinst paint.Net
cinst pip
cinst qbittorrent
cinst rufus
cinst skype
cinst speccy
cinst steam
cinst virtualbox
cinst vlc
cinst wget
cinst windirstat
cinst winscp
cinst wireshark
cinst youtube-dl
cinst teamspeak
cinst mumble
cinst spotify
cinst ditto
cinst firacode
#cinst f.lux
#cinst miktex
#cinst TeXstudio
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Development specific applications
cinst windowsazurelibsfornet
cinst NugetPackageExplorer
cinst curl
cinst cmder
cinst hyper
cinst cygwin
cinst docker
cinst docker-for-windows
cinst firacode
cinst fciv
cinst filezilla
cinst gcloudsdk
cinst git -params '"/GitAndUnixToolsOnPath"'
cinst git-credential-winstore
cinst intellijidea-community
cinst linqpad
cinst nuget.commandline
cinst nimbletext
cinst posh-git
cinst powershell
cinst azure-cli
cinst procexp
cinst putty
cinst python
cinst anaconda3 /AddToPath:1
cinst postman
cinst sysinternals
cinst vim
cinst visualstudiocode
cinst windbg
cinst winmerge
#cinst mongodb
#cinst scala
#cinst elasticsearch
#cinst dart-sdk
#cinst lessmsi
#cinst packer
#cinst golang
#cinst baretail
#cinst vagrant
#cinst devbox-clink
#cinst sql-server-express
#cinst vs 2017 !!!!!
#cinst resharper
#cinst tortoisegit
#cinst windowsazurepowershell
#cinst azurestorageexplorer cloudberryexplorer.azurestorage
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Add to Path environment variable
Install-ChocolateyPath -PathToInstall "$($Boxstarter.programFiles86)\Git"
Install-ChocolateyPath -PathToInstall "$($Boxstarter.programFiles86)\Git\bin"
#Install-ChocolateyPath 'LOCATION_TO_ADD_TO_PATH' 'User_OR_Machine' # Machine will assert administrative rights
$env:PSModulePath = $env:PSModulePath + ";C:\Program Files\Git\bin"
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Taskbar items and desktop icons
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Google\Chrome\Application\chrome.exe"
Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe"
Install-ChocolateyShortcut `
-ShortcutFilePath "C:\Users\Admin\Desktop\Notepad++.lnk" `
-TargetPath "C:\Program Files\Notepad++\notepad++.exe" `
-WindowStyle 3 `
-RunAsAdmin `
-PinToTaskbar
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
# Modify registy properties
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\15.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\17.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
Set-ItemProperty -Path HKCU:\Console\%SystemRoot%_system32_cmd.exe -Name QuickEdit -Type DWord -Value 0
Set-ItemProperty -Path HKCU:\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe -Name QuickEdit -Type DWord -Value 0
Set-ItemProperty -Path HKCU:\Console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe -Name QuickEdit -Type DWord -Value 0
### Finishing up
# Re-enable UAC
Enable-UAC
if (Test-PendingReboot) { Invoke-Reboot } # ------ REBOOT ------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment