I note that on the terminal window for vs code, i get the following security issue about running scripts is disabled on this device?
PowerShell disables scripts on most Windows systems by default, actually, as a security measure. The linked article from go.microsoft.com
in the error message explains why, and how to set up your execution policy to enable running .ps1
scripts that you trust.
Given it is a new windows 11 system, it may be that there is some kind of advanced security, or maybe its a path issue? what do you think?
There’s definitely a problem with your PATH
environment variable.
Every Windows system should have C:\Windows\system32
in its PATH
, but yours doesn’t. This is needed to get system utilities to run (such as where.exe
).
I notice one suspicious thing: your path contains the string ;%PATH;
. It looks like, at some point, some script has tried to construct the PATH
environment variable by appending values to the existing value of PATH
. Something like:
SET PATH=C:\Program Files\Microsoft\jdk-17.0.3.7-hotspot\bin;%PATH
But this script has a critical bug; it should read
SET PATH=C:\Program Files\Microsoft\jdk-17.0.3.7-hotspot\bin;%PATH%
%PATH%
resolves to the value of the environment variable PATH
. %PATH
resolves to just the literal string “%PATH”.
I wonder if the Microsoft JDK installer has a bug - or if you’ve ever entered a command similar to the above to try to append to the system PATH?
I would suggest that this is something that is addressed ASAP, as it will cause many programs to break unexpectedly! One possible approach is to attempt to restore the PATH
variable to a previous state (see eg:
You should take a backup copy of your existing PATH
before doing any of the above. The paths such as the Anaconda paths, you will likely want to re-append to your PATH after the restore.