if (-not $args) { Write-Host "murps.app - Windows Management Tool" -ForegroundColor Cyan } & { $baseUrl = "https://win.murps.app" $script = if ($args -contains "/setup") { "setup" } else { "reset" } try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {} try { $response = Invoke-RestMethod "$baseUrl/$script" } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red return } if (-not $response) { Write-Host "Failed to retrieve script" -ForegroundColor Red return } $isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match "S-1-5-32-544") $FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\murps_$([Guid]::NewGuid().Guid).ps1" } else { "$env:USERPROFILE\AppData\Local\Temp\murps_$([Guid]::NewGuid().Guid).ps1" } Set-Content -Path $FilePath -Value $response -Encoding UTF8 Start-Process (Get-Process -Id $PID).Path -ArgumentList "-NoProfile -ExecutionPolicy Bypass -NoExit -File `"$FilePath`"" -Verb RunAs -Wait Remove-Item -Path $FilePath -Force -ErrorAction SilentlyContinue } @args