-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Hi. I teach a course where students use VS Code to write and run Python executables. We've noticed that for students with recent Windows installations, the default execution policy has changed, causing this extension's attempts to activate their virtual environments to fail.
& : File C:\\Users\\me\\COMP1010\\Lab\\Week 3\\word_groups_starter\\.venv\\Scripts\\Activate.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
* & "c:\\Users\\me\\COMP1010\\Lab\\W …
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
While it would technically be possible to make students disable the execution policy by running Set-ExecutionPolicy -ExecutionPolicy Unrestricted in an administrator terminal, this is far from an ideal solution, as we do not want to encourage our students to perform actions that will reduce the security of their systems.
A better solution would be for this extension to run the script in such a way that the execution policy is bypassed, for example using these instructions from the Microsoft documentation.