-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwindows.ps1
88 lines (45 loc) · 2.23 KB
/
windows.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
Write-Host @"
-----------------------------------------------------------------------------
You're running the CodeClan Data Analysis setup script for Windows laptops.
If that isn't what you meant to do press ctrl + c to stop the script.
This script will install the necessary software for the course using the chocolatey package manager.
If you have any of these programs installed already they will be updated to the latest version.
If you already have the latest version of a program the script will skip it with a warning message.
-----------------------------------------------------------------------------
"@
# Install Chocolatey
Write-Output "Installing Chocolatey Package Manager..."
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Helper functions
function Install-FromChocolately {
param(
$Application
)
$applicationName = $Application.Name
Write-Output "Installing $applicationName..."
choco install $Application.PackageName -y -r
}
# Load list of apps to be installed
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/codeclan/data_laptop_script/master/applications.ps1" -OutFile "codeclan_applications.ps1"
. .\codeclan_applications.ps1
# App installation
$installationList | foreach {
Install-FromChocolately $_
}
Write-Output "Installing R..."
choco install r
Write-Output "Installing Quarto..."
choco install quarto
# refreshenv to add Java to PATH
Write-Output "Adding Java to PATH"
refreshenv
# Run final installation check
Write-Output "Checking installations..."
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/codeclan/data_laptop_script/master/laptop_install_test_windows.ps1" -OutFile "codeclan_installation_test.ps1"
.\codeclan_installation_test.ps1
Write-Host @"
-----------------------------------------------------------------------------
Script complete! Please flag any errors to your instructors at the Meet Your Cohort event.
Your Powershell session needs to be restarted before using the CLI tools installed.
-----------------------------------------------------------------------------
"@