@echo off
setlocal
title AgenteMonitoreo - Instalador

net session >nul 2>&1
if not "%errorlevel%"=="0" (
    powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
    exit /b
)

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Instalar-AgenteMonitoreo.ps1"
set "CODIGO=%errorlevel%"

echo.
pause
exit /b %CODIGO%
