This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomTerminal.ps1
91 lines (67 loc) · 2.57 KB
/
customTerminal.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
# Check if script is runing in root
if ('S-1-5-32-544' -notin [System.Security.Principal.WindowsIdentity]::GetCurrent().Groups) {
throw 'Script must run as admin!'
}
$ProgressPreference = 'SilentlyContinue'
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2
# Unlock scripts
Get-ChildItem -Filter *.ps1 | Unblock-File
Get-ChildItem -Filter .\components\*.ps1 | Unblock-File
mkdir .\tmp -Force
# Update NuGet packages
Install-PackageProvider -Name NuGet -Force
# Install-Module PowershellGet -Force
# Import installFonts
$ScriptRunInstallFonts= $PSScriptRoot+"\components\installFonts.ps1"
&$ScriptRunInstallFonts
# Install dependencies for components (e.g. .VC++)
$ScriptRunGetVLC= $PSScriptRoot+"\components\getVCLibs.ps1"
&$ScriptRunGetVLC
$ScriptRunGetVcRedist= $PSScriptRoot+"\components\getVcRedist.ps1"
&$ScriptRunGetVcRedist
$ScriptRunGetWinget= $PSScriptRoot+"\components\getWinget.ps1"
&$ScriptRunGetWinget
# Import getWindowsTerminal
$ScriptRunWindowsTerminal= $PSScriptRoot+"\components\getWindowsTerminal.ps1"
&$ScriptRunWindowsTerminal
# Import getPowerShell
$ScriptRunPowerShell= $PSScriptRoot+"\components\getPowerShell.ps1"
&$ScriptRunPowerShell
# Install scoop
iwr -useb get.scoop.sh -outfile '.\tmp\scoop.ps1'
.\tmp\scoop.ps1 -RunAsAdmin
# Install curl
scoop install curl sudo jq
# Install Git
# winget install -e --id Git.Git
choco install git -y
# Install NeoVim
scoop install neovim gcc
# Start wt and sleep for it starts
wt
sleep 5
taskkill /f /im WindowsTerminal.exe
# Import userProfile
$ScriptRunUserProfile= $PSScriptRoot+"\components\userProfile.ps1"
&$ScriptRunUserProfile
# Install Oh My Posh
Install-Module posh-git -Scope CurrentUser -Force
Install-Module oh-my-posh -Scope CurrentUser -Force
# Install nvm
scoop install nvm
# Install Terminal Icons
Install-Module -Name Terminal-Icons -Repository PSGallery -Force
# Install Z Shell
Install-Module -Name z -Force -AllowClobber
# Install PSReadLine - AutoCompletion
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
# Install fzf
scoop install fzf
Install-Module -Name PSFzf -Scope CurrentUser -Force
# Remove all tmp files
Remove-Item -path ".\tmp" -Force -Recurse -ErrorAction SilentlyContinue
# Finish message
wt
echo "Installation finished!"