151 lines
4.7 KiB
PowerShell
151 lines
4.7 KiB
PowerShell
# Check if the script is running as administrator
|
|
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
# If not running as administrator, attempt to restart with elevation
|
|
Write-Host "This script needs to run with Administrator privileges. Please Run again"
|
|
Exit
|
|
}
|
|
|
|
function Install-Zen {
|
|
Write-Host "Installing Zen"
|
|
winget install Zen-Team.Zen-Browser
|
|
}
|
|
|
|
function Config-Zen {
|
|
Write-Host "Creating Directory"
|
|
$folderPath = "C:\Program Files\Zen Browser\distribution"
|
|
if (-not (Test-Path $folderPath -PathType Container)) {
|
|
New-Item -Path $folderPath -ItemType Directory -Force
|
|
Write-Host "Folder '$folderPath' created successfully."
|
|
} else {
|
|
Write-Host "Folder '$folderPath' already exists."
|
|
}
|
|
Write-Host "Downloading Policy"
|
|
$download = "https://git.tcmeta.net/kurtis/win11-scripts/raw/branch/main/vargscript/zen-policy.json"
|
|
Invoke-WebRequest $download -Out "$folderPath\policy.json"
|
|
}
|
|
|
|
function Install-FlowLauncher {
|
|
Write-Host "Installing Flow Launcher"
|
|
winget install Flow-Launcher.Flow-Launcher
|
|
}
|
|
|
|
function Config-FlowLauncher {
|
|
$folderPath = "$ENV:APPDATA\FlowLauncher\Themes"
|
|
if (-not (Test-Path $folderPath -PathType Container)) {
|
|
New-Item -Path $folderPath -ItemType Directory -Force
|
|
Write-Host "Folder '$folderPath' created successfully."
|
|
} else {
|
|
Write-Host "Folder '$folderPath' already exists."
|
|
}
|
|
Write-Host "Downloading Theme"
|
|
$download = "https://git.tcmeta.net/kurtis/win11-scripts/raw/branch/main/vargscript/flow-95theme.xaml"
|
|
Invoke-WebRequest $download -Out "$folderPath\Windows 95.xaml"
|
|
}
|
|
|
|
function Install-NextCloud {
|
|
Write-Host "Installing Nextcloud"
|
|
winget install Nextcloud.NextcloudDesktop
|
|
}
|
|
|
|
function Install-SteamLink {
|
|
Write-Host "Installing Steamlink"
|
|
winget install Valve.SteamLink
|
|
}
|
|
|
|
function Install-Clink {
|
|
Write-Host "Installing Clink"
|
|
winget install chrisant996.Clink
|
|
}
|
|
|
|
function Install-Starship {
|
|
Write-Host "running Nerdfont installer"
|
|
& ([scriptblock]::Create((iwr 'https://to.loredo.me/Install-NerdFont.ps1')))
|
|
winget install Starship.Starship
|
|
Write-Host "Configuring CMD"
|
|
$folderPath = "$ENV:APPDATALOCAL\clink"
|
|
if (-not (Test-Path $folderPath -PathType Container)) {
|
|
New-Item -Path $folderPath -ItemType Directory -Force
|
|
Write-Host "Folder '$folderPath' created successfully."
|
|
} else {
|
|
Write-Host "Folder '$folderPath' already exists."
|
|
}
|
|
Set-Content -Path "$folderPath\starship.lua" -Value "load(io.popen('starship init cmd'):read(`"*a`"))()"
|
|
Write-Host "Configuring PowerShell"
|
|
$folderPath = "$([Environment]::GetFolderPath("MyDocuments"))\WindowsPowerShell"
|
|
if (-not (Test-Path $folderPath -PathType Container)) {
|
|
New-Item -Path $folderPath -ItemType Directory -Force
|
|
Write-Host "Folder '$folderPath' created successfully."
|
|
} else {
|
|
Write-Host "Folder '$folderPath' already exists."
|
|
}
|
|
Add-Content -Path "$folderPath\Microsoft.PowerShell_profile.ps1" -Value "Invoke-Expression (&starship init powershell)"
|
|
}
|
|
|
|
function Install-JaxCore {
|
|
Write-Host "Installing Jaxcore"
|
|
iwr -useb "https://raw.githubusercontent.com/Jax-Core/JaxCore/master/CoreInstaller.ps1" | iex
|
|
}
|
|
|
|
function Show-InteractiveMenu {
|
|
param (
|
|
[string]$Title = "Main Menu",
|
|
[array]$Options
|
|
)
|
|
|
|
Clear-Host
|
|
Write-Host "================ $Title ================"
|
|
|
|
for ($i = 0; $i -lt $Options.Count; $i++) {
|
|
Write-Host "$($i + 1): $($Options[$i])"
|
|
}
|
|
Write-Host "Q: Quit"
|
|
Write-Host "========================================"
|
|
}
|
|
|
|
$menuOptions = @(
|
|
"Run All",
|
|
"Install Zen Config",
|
|
"Install FlowLauncher Theme",
|
|
"Install Terminal Settings"
|
|
)
|
|
|
|
do {
|
|
Show-InteractiveMenu -Title "Onboarding Script" -Options $menuOptions
|
|
$choice = Read-Host "Enter your choice (1- $($menuOptions.Count), or Q to quit)"
|
|
|
|
switch ($choice) {
|
|
"1" {
|
|
Install-Zen
|
|
Config-Zen
|
|
Install-FlowLauncher
|
|
Config-FlowLauncher
|
|
Install-NextCloud
|
|
Install-SteamLink
|
|
Install-Clink
|
|
Install-Starship
|
|
Install-JaxCore
|
|
Pause
|
|
}
|
|
"2" {
|
|
Pause
|
|
}
|
|
"3" {
|
|
Pause
|
|
}
|
|
"4" {
|
|
Pause
|
|
}
|
|
"q" {
|
|
Write-Host "Exiting menu."
|
|
break
|
|
}
|
|
"Q" {
|
|
Write-Host "Exiting menu."
|
|
break
|
|
}
|
|
default {
|
|
Write-Host "Invalid choice. Please try again." -ForegroundColor Red
|
|
Pause
|
|
}
|
|
}
|
|
} while ($choice -ne "q" -and $choice -ne "Q") |