test: add a bypass wrapper for the UI smoke script

Windows PowerShell with an AllSigned policy refuses unsigned .ps1 files.
ui-smoke.cmd runs ui-smoke.ps1 with a process-scoped -ExecutionPolicy Bypass
(no system policy change) and keeps the window open when double-clicked.
This commit is contained in:
2026-11-04 17:12:32 +08:00
parent 590a9a016c
commit 2fc3f740ca
3 changed files with 17 additions and 4 deletions

11
agent/tests/ui-smoke.cmd Normal file
View File

@@ -0,0 +1,11 @@
@echo off
setlocal
rem Double-clickable wrapper: Windows PowerShell may refuse unsigned .ps1 files
rem (AllSigned policy). This runs the script with a process-scoped Bypass.
set "SCRIPT=%~dp0ui-smoke.ps1"
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT%" %*
set "CODE=%ERRORLEVEL%"
if not "%CODE%"=="0" echo.&echo UI smoke exited with code %CODE%.
rem Keep the window open when launched without arguments (double-click).
if "%~1"=="" pause
exit /b %CODE%