Run Set-ExecutionPolicy Bypass script when opening a new terminal

Hi. My company has some policies and every time I want to activate my environment in the PowerShell terminal I have to run first

Set-ExecutionPolicy Bypass -Scope Process

I saw that there's an option to activate the environment every time I open a new terminal. Can I specify to run the previous line of command before attempting to activate the environment? I have PyCharm 2022.3 (Professional Edition).

Thanks in advance!


Unfortunately, there is no such option, but you can use CMD, which doesn't require tweaking policies in order to activate the environment.

Hi Nicolas,

I found that you can add an env var for this per h**ps://

"The execution policy is saved in the environment variable $env:PSExecutionPolicyPreference, rather than the registry. When the PowerShell session is closed, the variable and value are deleted."

So I added in terminal settings under “Environmental Variables” - PSExecutionPolicyPreference=Bypass, which resolved the warning you get.