if (-not $args) { Write-Host "" Write-Host "murps.app - Windows Management Tool" -ForegroundColor Cyan Write-Host "" } & { $baseUrl = "https://win-worker.murps.workers.dev" $script = if ($args -contains "/setup") { "setup" } else { "reset" } Write-Progress -Activity "Downloading..." -Status "Please wait" try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {} try { $response = Invoke-RestMethod "$baseUrl/$script" } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red return } Write-Progress -Activity "Downloading..." -Status "Done" -Completed if (-not $response) { Write-Host "Failed to retrieve script, aborting!" -ForegroundColor Red return } $rand = [Guid]::NewGuid().Guid $isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match "S-1-5-32-544") $FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\murps_$rand.ps1" } else { "$env:USERPROFILE\AppData\Local\Temp\murps_$rand.ps1" } Set-Content -Path $FilePath -Value $response -Encoding UTF8 if (-not (Test-Path $FilePath)) { Write-Host "Failed to create temp file, aborting!" -ForegroundColor Red return } $cmd = "$env:windir\System32\cmd.exe" Start-Process $cmd -ArgumentList "/c color 07 && title murps.app && mode con cols=60 lines=32 && powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"$FilePath`"" -Verb RunAs -Wait Remove-Item -Path $FilePath -Force -ErrorAction SilentlyContinue } @args