-
Notifications
You must be signed in to change notification settings - Fork 0
/
boxstarter.ps1
168 lines (147 loc) · 4.54 KB
/
boxstarter.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
# Boxstarter script for marcinlawnik windows machines
# Created after one too many reinstalls
# To run (no reboots, may fail): START https://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/marcinlawnik/devmachine/main/boxstarter.ps1
# To run: START https://boxstarter.org/package/url?https://raw.githubusercontent.com/marcinlawnik/devmachine/main/boxstarter.ps1
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Get-AppxPackage Microsoft.windowscommunicationsapps | Remove-AppxPackage
Get-AppxPackage *windowsstore*|Remove-AppxPackage
# Boxstarter options
# https://boxstarter.org/winconfig
Disable-GameBarTips
#programming
choco install git
choco install phpstorm
choco install pycharm-edu
choco install nvm
#utilities
choco install firefox
choco install notepadplusplus
choco install anydesk.install
choco install 7zip
choco install keepassxc
choco install powertoys
#communication
choco install discord
#media
choco install vlc
choco install gimp
choco install k-litecodecpackbasic
choco install ffmpeg
choco install spotify
# ========
# Taskbar search removal - https://jdhitsolutions.com/blog/powershell/8424/hiding-taskbar-search-with-powershell/
# ========
Function Restart-Explorer {
<#
.Synopsis
Restart the Windows Explorer process.
#>
[cmdletbinding(SupportsShouldProcess)]
[Outputtype("None")]
Param()
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)"
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Stopping Explorer.exe process"
Get-Process -Name Explorer | Stop-Process -Force
#give the process time to start
Start-Sleep -Seconds 2
Try {
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Verifying Explorer restarted"
$p = Get-Process -Name Explorer -ErrorAction stop
}
Catch {
Write-Warning "Manually restarting Explorer"
Try {
Start-Process explorer.exe
}
Catch {
#this should never be called
Throw $_
}
}
Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)"
}
Function Disable-TaskBarSearch {
<#
.Synopsis
Disable the Windows taskbar search box
#>
[cmdletbinding(SupportsShouldProcess)]
[Alias("Hide-SearchBar")]
[OutputType("Boolean")]
Param()
Begin {
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)"
} #begin
Process {
Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Hiding Task Bar Search"
Try {
$splat = @{
Path = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search'
Name = 'SearchBoxTaskbarMode'
Value = 0
Type = 'DWord'
Force = $True
ErrorAction = 'Stop'
}
Set-ItemProperty @splat
if ($WhatIfPreference) {
#return false if using -Whatif
$False
}
else {
$True
}
}
Catch {
$False
Throw $_
}
Restart-Explorer
} #process
End {
Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)"
} #end
}
Function Enable-TaskBarSearch {
<#
.Synopsis
Enable the Windows taskbar search box
#>
[cmdletbinding(SupportsShouldProcess)]
[Alias("Show-SearchBar")]
[OutputType("Boolean")]
Param()
Begin {
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)"
} #begin
Process {
Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Showing Task Bar Search"
Try {
$splat = @{
Path = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search'
Name = 'SearchBoxTaskbarMode'
Value = 2
Type = 'DWord'
Force = $True
ErrorAction = 'Stop'
}
Set-ItemProperty @splat
if ($WhatIfPreference) {
#return false if using -Whatif
$False
}
else {
$True
}
}
Catch {
$False
Throw $_
}
Restart-Explorer
} #process
End {
Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)"
} #end
}
Disable-TaskBarSearch