简体   繁体   中英

Intellij not picking up correct execution policy for powershell

Ive changed my Powershell execution policy from Restricted to RemoteSigned . If I open up a new Powershell terminal and run Get-ExecutionPolicy I get back RemoteSigned .

I've also setup Powershell to run in Intellij instead of the default command prompt. However when I run Get-ExecutionPolicy in Intellij's terminals (note: I have restarted Intellij after changing the policy) I still get back Restricted .

Why is that and how do I get Intellij to pick up my actual execution policy?

There are multiple scopes of PowerShell execution policy ( MachinePolicy , UserPolicy , Process , CurrentUser , LocalMachine ). You can read about them in build-in PowerShell help: Get-Help about_Execution_Policies . But what is not mentioned in that help is, that LocalMachine scope is separate for x86 and x64. So, if you changing execution policy in LocalMachine scope, which used by default if you does not specify -Scope parameter for Set-ExecutionPolicy cmdlet, than you have to do it twice: once for x86 and once for x64.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM