mirror of
https://github.com/zsai001/vstats.git
synced 2026-09-08 18:27:39 +08:00
- Remove special handling for Local nodes - Add auto execution policy bypass and UAC elevation - Create separate agent-upgrade.ps1 and agent-uninstall.ps1 for clean irm | iex usage - Update README with simplified Windows commands - Update Settings.tsx install command generation
23 lines
747 B
PowerShell
23 lines
747 B
PowerShell
# vStats Agent Upgrade Script
|
|
# Usage: irm https://vstats.zsoft.cc/agent-upgrade.ps1 | iex
|
|
|
|
# Check if running as administrator
|
|
function Test-Administrator {
|
|
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
$principal = New-Object Security.Principal.WindowsPrincipal($currentUser)
|
|
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
}
|
|
|
|
if (-not (Test-Administrator)) {
|
|
Write-Host ""
|
|
Write-Host "⚠️ Administrator privileges required" -ForegroundColor Yellow
|
|
Write-Host "Please run PowerShell as Administrator" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
exit 1
|
|
}
|
|
|
|
# Load main script and execute upgrade
|
|
. {iex (irm https://vstats.zsoft.cc/agent.ps1)}
|
|
Update-VStatsAgent
|
|
|