@@ -21,22 +21,10 @@ type WindowsRunner struct{}
21
21
22
22
// Prepare the test
23
23
func (WindowsRunner ) Prepare (ctx context.Context , sshClient SSHClient , logger Logger , arch string , goVersion string ) error {
24
- // Adding the user directory as an exception to Windows Defender, so it does not detect
25
- // temporary mage binaries as malware.
26
- //
27
- // https://github.com/elastic/elastic-agent/issues/4355
28
- // https://learn.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=windowsserver2022-ps
29
- logger .Logf ("Adding exception in Windows Defender..." )
30
- defenderException := `Set-MpPreference -Force -ExclusionPath $env:USERPROFILE`
31
- stdOut , errOut , err := sshRunPowershell (ctx , sshClient , defenderException )
32
- if err != nil {
33
- return fmt .Errorf ("failed to add exception in Windows Defender: %w (stdout: %s, stderr: %s)" , err , stdOut , errOut )
34
- }
35
-
36
24
// install chocolatey
37
25
logger .Logf ("Installing chocolatey" )
38
26
chocoInstall := `"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"`
39
- stdOut , errOut , err = sshRunPowershell (ctx , sshClient , chocoInstall )
27
+ stdOut , errOut , err : = sshRunPowershell (ctx , sshClient , chocoInstall )
40
28
if err != nil {
41
29
return fmt .Errorf ("failed to install chocolatey: %w (stdout: %s, stderr: %s)" , err , stdOut , errOut )
42
30
}
0 commit comments