forked from microsoft/windows-dev-box-setup-scripts
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path7590_bootstrap.ps1
130 lines (113 loc) · 5.4 KB
/
7590_bootstrap.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Description: Boxstarter Script
# Author: neilkidd
# Bootstrap 7590 laptop - windows 10 pro
# To run
# 1.) Open an elevated PS V3 shell ( https://boxstarter.org/InstallBoxstarter )
# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force
# 2. Open BoxStarter Shell from the desktop shortcut
# $creds = Get-Credential
# Install-BoxstarterPackage -PackageName https://raw.githubusercontent.com/neilkidd/windows-dev-box-setup-scripts/master/machines/7590_bootstrap.ps1 -Credential $creds
Disable-UAC
$ConfirmPreference = "None" #ensure installing powershell modules don't prompt on needed dependencies
# Get the base URI path from the ScriptToCall value
$bstrappackage = "-bootstrapPackage"
$helperUri = $Boxstarter['ScriptToCall']
$strpos = $helperUri.IndexOf($bstrappackage)
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
$helperUri = $helperUri.TrimStart("'", " ")
$helperUri = $helperUri.TrimEnd("'", " ")
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
$helperUri += "/scripts"
write-host "helper script base URI is $helperUri"
function executeScript {
Param ([string]$script)
write-host "executing $helperUri/$script ..."
Invoke-Expression ((new-object net.webclient).DownloadString("$helperUri/$script"))
}
# Workaround choco / boxstarter path too long error
# https://github.com/chocolatey/boxstarter/issues/241
$chocoCachePath = "$env:TEMP"
if([string]::IsNullOrEmpty($chocoCachePath)) {
$chocoCachePath = "$env:USERPROFILE\AppData\Local\Temp\chocolatey"
}
Write-Host "Using chocoCachePath: $chocoCachePath"
if (-not (Test-Path -LiteralPath $chocoCachePath)) {
Write-Host "Creating chocoCachePath dir."
New-Item -Path $chocoCachePath -ItemType Directory -Force
}
#--- Setting up Windows ---
executeScript "FileExplorerSettings.ps1";
executeScript "SystemConfiguration.ps1";
executeScript "RemoveDefaultAppsExceptDell.ps1";
# Install apps
choco upgrade --cacheLocation="$chocoCachePath" --yes git.install --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal /NoAutoCrlf'"
Install-Module -Force posh-git
RefreshEnv
# ORDER MATTERS
# Firefox last - so it becomes the default
choco upgrade --cacheLocation="$chocoCachePath" --yes googlechrome
choco upgrade --cacheLocation="$chocoCachePath" --yes firefox --package-parameters="'/l=en-GB /RemoveDistributionDir'"
# Always required!
choco upgrade --cacheLocation="$chocoCachePath" --yes git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal /NoAutoCrlf'"
# Larger apps needing restarts speed up the process
choco upgrade --cacheLocation="$chocoCachePath" --yes sql-server-management-studio
# VS 2019 packages: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2019
choco upgrade --cacheLocation="$chocoCachePath" --yes visualstudio2019community --package-parameters "--add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.Data -add Microsoft.VisualStudio.Workload.NetCoreTools --passive --locale en-US"
choco upgrade --cacheLocation="$chocoCachePath" --yes chocolateygui
choco upgrade --cacheLocation="$chocoCachePath" --yes 7zip.install
choco upgrade --cacheLocation="$chocoCachePath" --yes libreoffice-fresh
choco upgrade --cacheLocation="$chocoCachePath" --yes gimp
choco upgrade --cacheLocation="$chocoCachePath" --yes bitwarden
# choco upgrade --cacheLocation="$chocoCachePath" --yes potplayer
choco upgrade --cacheLocation="$chocoCachePath" --yes synctrayzor
choco upgrade --cacheLocation="$chocoCachePath" --yes joplin
choco upgrade --cacheLocation="$chocoCachePath" --yes slack
choco upgrade --cacheLocation="$chocoCachePath" --yes zoom
choco upgrade --cacheLocation="$chocoCachePath" --yes microsoft-teams.install
choco upgrade --cacheLocation="$chocoCachePath" --yes authy-desktop
choco upgrade --cacheLocation="$chocoCachePath" --yes dropbox
choco upgrade --cacheLocation="$chocoCachePath" --yes dbeaver
choco upgrade --cacheLocation="$chocoCachePath" --yes postman
choco upgrade --cacheLocation="$chocoCachePath" --yes vscode.install
choco upgrade --cacheLocation="$chocoCachePath" --yes jetbrainstoolbox
choco upgrade --cacheLocation="$chocoCachePath" --yes f.lux.install
# pin self updating apps
# https://github.com/chocolatey/choco/wiki/CommandsPin
# To update all others, run 'choco upgrade all' from an elevated PS shell
# or use Chocolatey Gui
choco pin add -n=authy-desktop
choco pin add -n=bitwarden
choco pin add -n=dbeaver
choco pin add -n=dropbox
choco pin add -n=Firefox
choco pin add -n="f.lux.install"
choco pin add -n=GoogleChrome
choco pin add -n=jetbrainstoolbox
choco pin add -n=joplin
choco pin add -n=libreoffice-fresh
choco pin add -n="microsoft-teams.install"
choco pin add -n=postman
#choco pin add -n=potplayer
choco pin add -n=slack
choco pin add -n=synctrayzor
choco pin add -n=visualstudio2019community
choco pin add -n="vscode.install"
choco pin add -n=zoom
Enable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula
###############################################################################
# TODO Manually
#
# WSL2 - Breaks when scripted
# Manual steps work fine
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
#
# Docker Desktop
# https://www.docker.com/products/docker-desktop
#
# Windows Terminal (from Windows Store)
# Using the choco package means the latest releases lag and is 'orphaned' from
# the store releases.
#
###############################################################################