-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWindow.ps1
61 lines (50 loc) · 3.29 KB
/
Window.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
# Script Parts
# Admin Check
# Check system
# 1. Scoop Check
# 2. Winget Check
# Install application
# 1. Winget Install
# 2. Scoop install application
# Placing the configuration files into the correct place
# 1. lsd config
# 2. neofetch config
# 3. starship promote
# 4. Window Terminal config File
# 5. PowerShell Config files
# 6. PowerShell
Write-Output"
██╗ ██╗██╗███╗ ██╗██████╗ ██████╗ ██╗ ██╗███████╗ ███████╗ ██████╗██████╗ ██╗██████╗ ████████╗
██║ ██║██║████╗ ██║██╔══██╗██╔═══██╗██║ ██║██╔════╝ ██╔════╝██╔════╝██╔══██╗██║██╔══██╗╚══██╔══╝
██║ █╗ ██║██║██╔██╗ ██║██║ ██║██║ ██║██║ █╗ ██║███████╗ ███████╗██║ ██████╔╝██║██████╔╝ ██║
██║███╗██║██║██║╚██╗██║██║ ██║██║ ██║██║███╗██║╚════██║ ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║
╚███╔███╔╝██║██║ ╚████║██████╔╝╚██████╔╝╚███╔███╔╝███████║ ███████║╚██████╗██║ ██║██║██║ ██║
╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝
"
# Check if the script is running as administrator
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Write-Host "PowerShell session is not running with administrator privileges. Exiting..."
exit
} else {
Write-Host "PowerShell session is running with administrator privileges."
try {
# Commands that are required
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -ErrorAction Stop
Install-Module -Name Terminal-Icons -Repository PSGallery -ErrorAction Stop
# Running Parts:
# Check for winget
.\winget-check.ps1
# Check for scoop
.\scoop_check.ps1
# Installing Fonts
.\install-fonts.ps1
# Installing application
.\installApp.ps1
# Moving Files
.\Files.ps1
} catch {
Write-Host "❌ An error occurred: $_.Exception.Message" -ForegroundColor Red
Write-Host "Exiting script due to an error." -ForegroundColor Yellow
}
}