@echo off
setlocal
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; $p=Join-Path $env:TEMP ('lablink-install-'+[Guid]::NewGuid().ToString('N')+'.ps1'); try { Invoke-WebRequest -UseBasicParsing -Uri 'https://lablink.test.qifalab.cn/download/install.ps1' -OutFile $p -TimeoutSec 60; if ((Get-FileHash -Algorithm SHA256 -LiteralPath $p).Hash.ToLowerInvariant() -ne '1a896f50b7bee0ff2308cc846ede85639bebbd7398ab9247f237fa3d61de57e6') { throw 'Installer SHA256 mismatch' }; & $p } finally { if(Test-Path $p) { Remove-Item -LiteralPath $p -Force } }"
if errorlevel 1 (
  echo Installation failed. Preserve the message above and ask your operator before retrying enrollment.
  pause
  exit /b 1
)
pause
