mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
Configure defender process exceptions when running tests (#13470)
* Configure defender process exceptions when running tests * Use explicit %ls * Save state * Save state * Add exceptions before the package is installed * Remove extra call
This commit is contained in:
parent
25f7a7b38c
commit
2eac1dafec
@ -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());
|
||||
}
|
||||
|
||||
|
||||
@ -5,3 +5,7 @@ setx /M CloudTestWorkerCustomTaefExe "%1\taef\te.exe"
|
||||
|
||||
mkdir %2\WexLogFileOutput
|
||||
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')"
|
||||
Loading…
x
Reference in New Issue
Block a user