diff --git a/test/windows/Common.cpp b/test/windows/Common.cpp index 04023e4..2c30e7f 100644 --- a/test/windows/Common.cpp +++ b/test/windows/Common.cpp @@ -2071,16 +2071,6 @@ Return Value: THROW_HR_MSG(E_FAIL, "Test setup returned non-zero exit code %lu", ExitCode); } - if (!g_pipelineBuildId.empty()) - { - LxsstuRunCommand(std::format( - L"Powershell -NoProfile -Command \"Add-MpPreference -ExclusionPath '{}'\"", - wsl::windows::common::wslutil::GetMsiPackagePath().value()) - .data()); - - LxsstuRunCommand(std::format(L"Powershell -NoProfile -Command \"Add-MpPreference -ExclusionPath '.'\"").data()); - } - return true; } @@ -2128,7 +2118,7 @@ Return Value: commandLine = std::format(L"Get-MpThreat > \"{}\\Get-MpThreat.txt\"", g_dumpFolder); LxsstuLaunchPowershellAndCaptureOutput(commandLine.data()); - commandLine = std::format(L"Get-MpPreference > \"{}\\Get-MpPreference\"", g_dumpFolder); + commandLine = std::format(L"Get-MpPreference > \"{}\\Get-MpPreference.txt\"", g_dumpFolder); LxsstuLaunchPowershellAndCaptureOutput(commandLine.data()); } diff --git a/tools/test/CloudTest-Setup.bat b/tools/test/CloudTest-Setup.bat index d32aef1..f44f88a 100644 --- a/tools/test/CloudTest-Setup.bat +++ b/tools/test/CloudTest-Setup.bat @@ -4,4 +4,8 @@ rem Required to make cloudtest use our version of taef setx /M CloudTestWorkerCustomTaefExe "%1\taef\te.exe" mkdir %2\WexLogFileOutput -mklink /D %1\WexLogFileOutput %2\WexLogFileOutput \ No newline at end of file +mklink /D %1\WexLogFileOutput %2\WexLogFileOutput + +rem These need to run before the package is installed +powershell -NoProfile -Command "Add-MpPreference -ExclusionPath 'C:\Program Files\WSL'" +powershell -NoProfile -Command "Add-MpPreference -ExclusionProcess @('wsl.exe', 'wslg.exe', 'wslconfig.exe', 'wslrelay.exe', 'wslhost.exe', 'msrdc.exe', 'wslservice.exe', 'msal.wsl.proxy.exe', 'te.processhost.exe')" \ No newline at end of file