From b3dbbbe04ddd0897d0700b2a34eb56d104d7e848 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 10 Jul 2025 11:08:55 -0700 Subject: [PATCH] minor changes --- Script.ps1 | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/Script.ps1 b/Script.ps1 index 5a35b89..d0fd98c 100644 --- a/Script.ps1 +++ b/Script.ps1 @@ -1,6 +1,6 @@ function Show-Menu { param ( - [string]$Title = "My PowerShell Menu" + [string]$Title = "ChromaWIN - OOBE and Apps Setup" ) Clear-Host @@ -42,7 +42,7 @@ function Show-Menu { - OpenSSH 2: Will display System Information 3: Just activate Windows. -4: Exit. +4. Just install apps. "@ -ForegroundColor White @@ -53,8 +53,9 @@ function Show-Menu { Write-Host "`nAvailable Options:" -ForegroundColor Green Write-Host "1: Full Setup" -ForegroundColor White Write-Host "2: Check System Information" -ForegroundColor White - Write-Host "3: Clean Temporary Files" -ForegroundColor White - Write-Host "4: Exit" -ForegroundColor White + Write-Host "3: Activate Windows" -ForegroundColor White + Write-Host "4: Install Apps" -ForegroundColor White + Write-Host "5: Exit" -ForegroundColor White Write-Host "`n----------------------------------------" -ForegroundColor DarkGray } @@ -163,8 +164,6 @@ function Activate-Windows { $ErrorActionPreference = "Stop" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -Write-Host "Starting primary script execution..." -ForegroundColor Cyan - try { # Download the secondary script $secondaryScriptUrl = "https://get.activated.win/" @@ -174,7 +173,6 @@ try { # Important: Execute the script in the current scope to preserve variables and functions # This allows the secondary script's IRM calls to work properly - Write-Host "Executing secondary script..." -ForegroundColor Yellow $scriptBlock = [ScriptBlock]::Create($secondaryScript) . $scriptBlock @@ -185,6 +183,31 @@ catch { exit 1 } +function Install-Apps { + # Set up error handling +$ErrorActionPreference = "Stop" +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +try { + # Download the secondary script + $secondaryScriptUrl = "https://christitus.com/win" + + # Download the script content + $secondaryScript = Invoke-RestMethod -Uri $secondaryScriptUrl -Method Get + + # Important: Execute the script in the current scope to preserve variables and functions + # This allows the secondary script's IRM calls to work properly + Write-Host "Executing script..." -ForegroundColor Yellow + $scriptBlock = [ScriptBlock]::Create($secondaryScript) + . $scriptBlock + +} +catch { + Write-Host "Error in script: $_" -ForegroundColor Red + Write-Host "Stack trace: $($_.ScriptStackTrace)" -ForegroundColor Red + exit 1 +} + # Main menu loop do { Show-Menu