forked from carlosearm/MachineSetup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
50 lines (41 loc) · 1.76 KB
/
install.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
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("'", " ")
$strpos = $helperUri.LastIndexOf("/")
$helperUri = $helperUri.Substring(0, $strpos)
$helperUri += "/scripts"
write-host "helper script base URI is $helperUri"
function executeScript {
Param ([string]$script)
write-host "executing $helperUri/$script ..."
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
}
$path = 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell'
$key = Get-Item -LiteralPath $path -ErrorAction SilentlyContinue
if ($key -eq $null)
{
(get-item HKLM:\Software\Policies\Microsoft).OpenSubKey("Windows", $true).CreateSubKey("PowerShell")
}
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\PowerShell" -Name "EnableScripts" -Value 00000001 -Type DWORD
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\PowerShell" -Name "ExecutionPolicy" -Value "Unrestricted"
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
#--- Setting up Windows ---
executeScript "FileExplorerSettings.ps1";
executeScript "dev_app_desktop_.net.ps1";
executeScript "browsers.ps1";
executeScript "WUpdates.ps1";
#choco install -y powershell-core
#RefreshEnv
#Enable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
#Add Windows Credential
executeScript "AddWindowsCredentials.ps1";
#Turning .NetFramework3.5 on
executeScript "NetFramework35.ps1";