-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstallEverything.ps1
70 lines (57 loc) · 2.47 KB
/
InstallEverything.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
# General variables:
$DownloadPath = "https://github.com/microsoft/winget-cli/releases/download/v1.0.11451/DesktopAppInstallerPolicies.zip"
$DesktopPath = [Environment]::GetFolderPath("Desktop")
$WorkPath = "$DesktopPath\INTERallianceInstall"
# Node.js variables:
$NodeName = "node-v16.3.0-win-x64"
$NodeURL = "https://nodejs.org/dist/v16.3.0/$NodeName.zip"
$NodeZipLocation = "$WorkPath\$NodeName.zip"
$InstallationDestination = "$env:userprofile"
$RealInstallPath = "$InstallationDestination\$NodeName"
# Remove path if it already exists, so that this script can be run repeatedly
If (Test-Path $WorkPath){
Remove-Item $WorkPath -Recurse
}
If (Test-Path $RealInstallPath){
Remove-Item $RealInstallPath -Recurse
}
# We can't start the transcript before we delete the files
Start-Transcript -Path "$WorkPath\transcript_$(Get-Date -Format "MM-dd-yyyy_HH-mm").txt" -NoClobber
# Delete everything, so that we can run the script multiple times, if something goes wrong.
New-Item -ItemType directory -Path $WorkPath
echo "Download winget"
$Url = "https://github.com/microsoft/winget-cli/releases/download/v1.0.11692/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
$DownloadedLocation = "$WorkPath\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
Invoke-WebRequest -Uri $Url -OutFile $DownloadedLocation
echo ""
echo "Install Windows App Installer"
Add-AppxPackage -Path $DownloadedLocation
echo ""
echo "Use Windows App Installer to install other things:"
echo ""
echo "Installing VSCode..."
winget install --id=Microsoft.VisualStudioCode -e -h --scope "user" ;
echo "Installing Windows Terminal..."
winget install --id=Microsoft.WindowsTerminal -e -h ;
echo "Installing Git..."
winget install -e --id Git.Git
echo "Installing Slack..."
winget install -e --id SlackTechnologies.Slack
echo ""
echo "Installing Node.JS ..."
echo "NodeURL = $NodeURL"
echo "NodeZipLocation = $NodeZipLocation"
echo ""
# Download zip file:
echo "Downloading Node.JS binary."
echo "This may take a while..."
(New-Object System.Net.WebClient).DownloadFile($NodeURL, $NodeZipLocation)
echo ""
echo "Extracting from zip file..."
Expand-Archive $NodeZipLocation -DestinationPath $InstallationDestination
echo ""
echo "Add nodejs path to user Env:Path"
$CurrentPath = [Environment]::GetEnvironmentVariable("Path", "User")
$AppendedPath = "$CurrentPath;$RealInstallPath;"
[Environment]::SetEnvironmentVariable("Path", $AppendedPath, "User")
Start-Sleep -s 5