-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap-deepseek.ps1
220 lines (203 loc) · 6.84 KB
/
bootstrap-deepseek.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Filename: setup.ps1
# Description: PowerShell script to set up a Windows environment with Scoop, Winget, and various tools.
# Usage: Run this script in PowerShell with administrative privileges.
# Function to write colored output
function Write-ColorOutput {
param (
[string]$Message,
[string]$Color = "White"
)
$colorMap = @{
"Green" = "32"
"Red" = "31"
}
$colorCode = $colorMap[$Color]
Write-Host -ForegroundColor $Color $Message
}
# Ensure the Windows Time service is running and set to start automatically
Set-Service -Name W32Time -Status Running -StartupType Automatic
# Check if Scoop is installed, and install it if not
if (!(Get-Command "scoop" -ErrorAction SilentlyContinue)) {
Write-ColorOutput -Message "Scoop is not installed. Installing Scoop..." -Color "Green"
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force # Requires confirmation with 'A' (All)
Invoke-WebRequest -Uri https://get.scoop.sh -UseBasicParsing | Invoke-Expression
} else {
Write-ColorOutput -Message "Scoop is already installed." -Color "Green"
}
# Check if Winget is installed, and install it via Scoop if not
if (!(Get-Command "winget" -ErrorAction SilentlyContinue)) {
Write-ColorOutput -Message "Winget is not installed. Installing Winget via Scoop..." -Color "Green"
scoop install main/winget
} else {
Write-ColorOutput -Message "Winget is already installed." -Color "Green"
}
# Add required Scoop buckets
$buckets = @(
"main",
"extras",
"versions",
"nonportable",
"nerd-fonts",
"java",
"games",
"charm https://github.com/charmbracelet/scoop-bucket.git"
)
# Install Git (required for adding buckets)
scoop install main/git-with-openssh
# Add each bucket if it doesn't already exist
foreach ($bucket in $buckets) {
try {
$existingBuckets = scoop bucket list | Select-String -Pattern $bucket
if ($existingBuckets) {
Write-ColorOutput -Message "Bucket '$bucket' is already added." -Color "Green"
} else {
Write-ColorOutput -Message "Adding bucket '$bucket'..." -Color "Green"
scoop bucket add $bucket
}
} catch {
Write-ColorOutput -Message "Failed to add bucket '$bucket': $_" -Color "Red"
}
}
Write-ColorOutput -Message "All buckets processed." -Color "Green"
# Define tools to install via Scoop, categorized by type
$tools = @{
"CLI Tools" = @(
"main/starship",
"main/gsudo",
"main/ffmpeg",
"main/hugo-extended",
"main/restic",
"main/wget",
"main/curl",
"main/uutils-coreutils",
"main/7zip",
"main/neovim",
"main/helix",
"main/zoxide",
"main/fzf",
"main/fd",
"extras/winmtr",
"main/nmap",
"main/bottom",
"main/bat",
"main/chezmoi",
"main/nu",
"main/eza",
"main/file",
"main/grep",
"main/ripgrep",
"main/bitwarden-cli",
"main/gawk",
"main/which"
)
"GUI Productivity" = @(
"extras/pdfsam",
"extras/flameshot",
"extras/flow-launcher",
"extras/everything",
"extras/thunderbird",
"extras/onecommander",
"extras/simplenote"
)
"GUI Development" = @(
"extras/vscodium",
"extras/lapce",
"versions/firefox-developer",
"extras/windows-terminal",
"extras/wezterm",
"nonportable/virtualbox-np"
)
"GUI Media" = @(
"extras/mpc-qt",
"extras/jellyfin-mpv-shim",
"extras/makemkv",
"extras/handbrake"
)
"GUI Utilities" = @(
"extras/teamviewer",
"extras/etcher",
"extras/windirstat",
"extras/bitwarden",
"extras/clamav",
"extras/quicklook",
"extras/komorebi",
"extras/whkd",
"extras/f.lux",
"extras/painter"
)
"Gaming" = @(
"extras/playnite",
"extras/nvcleanstall",
"nonportable/logitech-gaming-software-np",
"versions/steam",
"games/battlenet"
)
"Internet & File Management" = @(
"extras/winscp",
"extras/librewolf",
"extras/nextcloud",
"extras/transmission"
)
"Fonts" = @(
"nerd-fonts/AnonymousPro-NF-Mono",
"nerd-fonts/Hack-NF-Mono",
"nerd-fonts/FiraCode-NF-Mono",
"nerd-fonts/JetBrainsMono-NF-Mono",
"nerd-fonts/Meslo-NF-Mono"
)
}
# Install tools by category
foreach ($category in $tools.GetEnumerator()) {
Write-ColorOutput -Message "Installing tools for $($category.Key)..." -Color "Green"
foreach ($tool in $category.Value) {
# Check if the tool is already installed
$toolName = ($tool -split "/")[-1] # Extract tool name from bucket/tool format
if (scoop list | Select-String -Pattern $toolName -Quiet) {
Write-ColorOutput -Message "$toolName is already installed." -Color "Green"
} else {
Write-ColorOutput -Message "Installing $toolName..." -Color "Green"
scoop install $tool
}
}
}
# Install additional packages via Winget
$wingetInstallations = @(
"Microsoft.PowerShell",
"Beeper.Beeper",
"Corsair.iCUE.4",
"PrivateInternetAccess.PrivateInternetAccess",
"tailscale.tailscale"
)
Write-ColorOutput -Message "Installing tools with Winget..." -Color "Green"
foreach ($package in $wingetInstallations) {
# Check if the package is already installed
if (winget list --id $package -e -q) {
Write-ColorOutput -Message "$package is already installed." -Color "Green"
} else {
Write-ColorOutput -Message "Installing $package..." -Color "Green"
winget install -e --id $package
}
}
# Install PSWindowsUpdate module for managing Windows updates
Write-ColorOutput -Message "Installing PSWindowsUpdate module..." -Color "Green"
Install-Module -Name PSWindowsUpdate -Force -Scope CurrentUser
# Run Windows updates
Write-ColorOutput -Message "Checking for Windows updates..." -Color "Green"
Get-WindowsUpdate -Install -AcceptAll -AutoReboot
# Prompt for restart if required
if (Test-PendingReboot) {
Write-ColorOutput -Message "A system restart is required to complete updates." -Color "Red"
$restart = Read-Host "Do you want to restart now? (Y/N)"
if ($restart -eq "Y" -or $restart -eq "y") {
Restart-Computer -Force
} else {
Write-ColorOutput -Message "Please restart your system later to complete updates." -Color "Red"
}
} else {
Write-ColorOutput -Message "No restart is required at this time." -Color "Green"
}
Write-ColorOutput -Message "Installation process completed!" -Color "Green"
# Manual Installations (not automated)
Write-ColorOutput -Message "Manually install the following:" -Color "Green"
Write-ColorOutput -Message "- Anytype" -Color "Green"
Write-ColorOutput -Message "- FileJuggler" -Color "Green"