fix(deploy): inlocuieste #Requires Administrator cu auto-elevare in update.ps1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 16:09:04 +02:00
parent 2954bd5780
commit 790edf82bf

View File

@@ -1,4 +1,3 @@
#Requires -RunAsAdministrator
<#
.SYNOPSIS
BTGO Telegram Bot - Update & Restart
@@ -6,6 +5,12 @@
git pull + restart serviciu
#>
# Auto-elevare daca nu e Administrator
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
$ErrorActionPreference = "Stop"
$ServiceName = "BTGOTelegramBot"
$ScriptDir = Split-Path -Parent $PSCommandPath