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.
12 lines
519 B
Batchfile
12 lines
519 B
Batchfile
@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%
|