0

I'm trying to download the chocolatey software on my windows laptop (https://chocolatey.org/) using powershell. My only problem is, that I get an error when I execute the download command line in powershell. Whenever I execute the download command it says:

This script contains malicious content and has been blocked by your antivirus software.

The script I'm using is:

Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; 
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
zett42
  • 25,437
  • 3
  • 35
  • 72
PunPun
  • 17
  • 4
  • Do you have an anti-virus program running? – eglease Nov 17 '21 at 16:33
  • I have mcafee on my laptop but i dont have a license for it(it was already downloaded when i bought it). Other then that i didn't download any new anti-virus program. – PunPun Nov 17 '21 at 16:35
  • Did you disable McAfee? Please add the script you are using to the question. – eglease Nov 17 '21 at 16:41
  • I can't open mcafee. When i open it, it asks me for an activation key. – PunPun Nov 17 '21 at 16:47
  • The script i'm using : Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) – PunPun Nov 17 '21 at 16:47
  • Please edit the question and add the script there instead of comments. Can you look at Services to see if McAfee is running? Do you have Windows Security running? – eglease Nov 17 '21 at 16:51
  • Also, have you tried `Invoke-WebRequest $url -OutFile $path_to_file`? – eglease Nov 17 '21 at 16:53
  • Seems like Windows Defender Firewall is running, and also some mcafee programs (firewall core service) – PunPun Nov 17 '21 at 16:57
  • Try disabling them and see if it works. – eglease Nov 17 '21 at 16:58
  • 1
    This is propably because of `Invoke-Expression` (`iex`), which can be considered dangerous as you are running code from a potentially untrusted source. Download to file as previous commenter suggests, then run the file. – zett42 Nov 17 '21 at 16:58
  • Here is how you can do the download: https://stackoverflow.com/questions/51225598/downloading-a-file-with-powershell – eglease Nov 17 '21 at 17:01
  • 3
    McAfee is known to block the chocolatey installer, giving that specific message: https://github.com/chocolatey/choco/issues/2132#issuecomment-720966342 . If it's unlicensed, I would recommend removing it... – Cpt.Whale Nov 17 '21 at 17:04
  • 1
    Thanks everyone for commenting, the problem was indeed mcafee, i bought it and disabled real time scanning. After disabling real time scanning, the command executed just fine. – PunPun Nov 17 '21 at 21:00

0 Answers0