reopen shell or run refreshenv in powershell
- Run powershell with admin priviledge
- Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned -Force. And then run Get-ExecutionPolicy, it should output AllSigned.
- Run the following command: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))