diff --git a/deploy-plugin.bat b/deploy-plugin.bat index 92538ad..7bdb221 100644 --- a/deploy-plugin.bat +++ b/deploy-plugin.bat @@ -19,7 +19,7 @@ if %ERRORLEVEL% EQU 0 ( REM Normal deploy failed. Elevate and retry. echo Deployment failed with current user permissions. Retrying with administrator rights... -PowerShell -Command "Start-Process -FilePath 'pwsh.exe' -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"%SCRIPT_DIR%deploy-body.ps1\"' -Verb RunAs -Wait" +pwsh -Command "Start-Process -FilePath 'pwsh.exe' -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"%SCRIPT_DIR%deploy-body.ps1\"' -Verb RunAs -Wait" if errorlevel 1 ( echo Deployment failed. diff --git a/run-ground-virtual-collision-test.bat b/run-ground-virtual-collision-test.bat index e38e421..5389e86 100644 --- a/run-ground-virtual-collision-test.bat +++ b/run-ground-virtual-collision-test.bat @@ -1,7 +1,7 @@ @echo off setlocal -powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\run-ground-virtual-collision-test.ps1" %* +pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\run-ground-virtual-collision-test.ps1" %* if errorlevel 1 exit /b 1 exit /b 0 diff --git a/run-unit-tests.bat b/run-unit-tests.bat index 64220ca..10bf1d8 100644 --- a/run-unit-tests.bat +++ b/run-unit-tests.bat @@ -21,11 +21,18 @@ if not exist %VSTEST_PATH% ( exit /b 1 ) -set TEST_ADAPTER_PATH="packages\MSTest.TestAdapter.3.0.4\build\net462" -if not exist %TEST_ADAPTER_PATH% ( - echo MSTest adapter path not found: %TEST_ADAPTER_PATH% +REM 动态查找 MSTest adapter(避免包版本升级后硬编码路径失效) +for /d %%d in ("packages\MSTest.TestAdapter.*") do set TEST_ADAPTER_BASE=%%~fd +if not defined TEST_ADAPTER_BASE ( + echo MSTest adapter package not found under packages\MSTest.TestAdapter.* exit /b 1 ) +set "TEST_ADAPTER_PATH=%TEST_ADAPTER_BASE%\build\net462" +if not exist "%TEST_ADAPTER_PATH%" ( + echo MSTest adapter net462 dir not found: %TEST_ADAPTER_PATH% + exit /b 1 +) +echo Using MSTest adapter: %TEST_ADAPTER_PATH% set NAVISWORKS_PATH=C:\Program Files\Autodesk\Navisworks Manage 2026 if not exist "%NAVISWORKS_PATH%\Autodesk.Navisworks.Api.dll" ( diff --git a/start-navisworks.bat b/start-navisworks.bat index fcffa3c..71775c0 100644 --- a/start-navisworks.bat +++ b/start-navisworks.bat @@ -1,7 +1,7 @@ @echo off setlocal -powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\start-navisworks.ps1" %* +pwsh -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\start-navisworks.ps1" %* if errorlevel 1 exit /b 1 exit /b 0