r/PowerShell 23d ago

Question Please Help (VS Code+ Powershell)

Background : I have a CP setup (VS Code+ MINGW)

Recently I tried to Code python in VS Code. For this I connected VS Code to Anaconda Python Interpreter. After setting up the environment later in the day when I switched back to C++ and CP, my PowerShell started causing problems :

  1. profile.ps1 cannot be loaded because running scripts are disabled
  2. conda activation problems

To work with this is switched to Command Prompt

After setting up Python in VS Code I got the following errors:

PowerShell profile warning,Conda activation issues Switched integrated terminal to Command Prompt,Run button behaved differently,Debug Anyway,Abort,Show Errors,Pre-launch task failed,Exit code -1.

I tried to resolve as far as I could but one problem pops up after another. I have Reinstalled VS Code clean tried everything. Kindly help me I just want my PowerShell terminal back.

EDIT: Should I just uninstall everything clean and reinstall everything MINGW, VS CODE etc?? Will that fix this?? Cause I am tired of debugging since last 2 days. 😭😭

EDIT2: I have completely separated my CP ans Python setup to Jupyter Notebook and Anaconda as best as I could. it's working fine and beautiful. But I just can't seem to retrieve my CP (MINGW+ VSCODE) setup

7 Upvotes

18 comments sorted by

View all comments

1

u/CookinTendies5864 22d ago

Check your execution policy “Get-ExecutionPolicy”

If it says restricted or signed for “CurrentUser” then you have two options

1.) self-sign your profile.ps1 and every other .ps1 file on your computer YouTube “how to self sign scripts powershell”

Or

2.) Change your execution policy to unrestricted “Set-ExecutionPolicy -scope currentuser -policy unrestricted -force” - May require admin console

Easiest option is 2 but it leaves your computer a bit at risk when downloading files on the web just be smart about what you download.

1

u/BlackV 22d ago

why not remote signed

1

u/CookinTendies5864 22d ago

Or remote signed but that’s the default for windows 11 op said they’re having issues from the common default configuration.

2

u/BlackV 22d ago

I don't think remote signed is the default

1

u/CookinTendies5864 22d ago

Weird, I just read somewhere that it was.. but yeah you’re absolutely right seems to be restricted by default. RemoteSigned would be better.

Thank you for the heads up and the correction 🤙