2

I am trying to run jenv Java Enviroment Handler for windows and the ps1 file used is unsigned. This shouldn't be an issue since i set Process, CurrentUser and LocalMachine to Unrestricted yet the error still appears. I also tried setting these variables to Bypass to cover my bases.

PS > jenv
SecurityError: File D:\sdk\JEnv-for-Windows-main\src\jenv.ps1 cannot be loaded. The file D:\sdk\JEnv-for-Windows-main\src\jenv.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.

PS > Get-ExecutionPolicy -list

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process          Bypass
  CurrentUser          Bypass
 LocalMachine          Bypass

I'm thinking it might be blocked by the other ExecutionPolicy but didn't find much info online regarding those.

  • 1
    try with `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser` – Santiago Squarzon Apr 02 '23 at 23:29
  • Hey, i tried this command and the exact same error appears. I also tried with LocalMachine, CurrentUser and Process scope for unrestricted and the same thing happens – Kevin Barker Apr 03 '23 at 12:22
  • 1
    Try : Unblock-File cmdlet. See : https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.3 – jdweng Apr 03 '23 at 17:06
  • Unblock-File cmdlet worked perfectly, thanks so much! curious at to why the other answer didn't work though – Kevin Barker Apr 03 '23 at 23:55

0 Answers0