-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.ps1
67 lines (59 loc) · 1.59 KB
/
Main.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
# Description: Boxstarter Script
# Author: Naqushab
# Dev Env Setup
Enable-RemoteDesktop
Disable-UAC
Update-ExecutionPolicy Unrestricted
# 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("/"))
write-host "Helper script base URI: $helperUri"
function executeScript {
Param ([string]$script)
$scriptUri = $helperUri + "/scripts"
write-host "Executing Script: $scriptUri/$script"
iex ((new-object net.webclient).DownloadString("$scriptUri/$script"))
}
function executeConfig {
Param ([string]$config)
$configUri = $helperUri + "/configs"
write-host "Executing Config: $configUri/$config ..."
iex ((new-object net.webclient).DownloadString("$configUri/$config"))
}
$scriptsList = @(
"Fonts.ps1"
"Browsers.ps1"
"CommonTools.ps1"
"IDEAndTooling.ps1"
"ProgrammingLanguages.ps1"
"HyperV.ps1"
"WSL.ps1"
"Docker.ps1"
);
$configsList = @(
"Adblock.ps1"
"RemoveDefaultApps.ps1"
"SystemConfiguration.ps1"
"TaskBar.ps1"
"FileExplorerSettings.ps1"
"Git.ps1"
"VSCode.ps1"
);
#--- Setting up Windows ---
foreach ($script in $scriptsList) {
executeScript $script
Update-SessionEnvironment
}
foreach ($config in $configsList) {
executeConfig $config
Update-SessionEnvironment
}
#--- reenabling critial items ---
Enable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula