file cannot be loaded because the execution of scripts is disabled on this system

ef-code-first entity-framework powershell

Question

File C:\Users\Acer\Desktop\Projelerim\BEM_CANLI\BEM\packages\EntityFramework.5.
0.0\tools\init.ps1 cannot be loaded because its execution is blocked by softwar
e restriction policies. For more information, contact your system administrator.
At line:1 char:44
+ $__pc_args=@(); $input|%{$__pc_args+=$_}; & <<<<  'C:\Users\Acer\Desktop\Proj
elerim\BEM_CANLI\BEM\packages\EntityFramework.5.0.0\tools\init.ps1' $__pc_args[
0] $__pc_args[1] $__pc_args[2]; Remove-Variable __pc_args -Scope 0
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

I get above error in package manager console. I found some solution, but I cant fix it. I tried followings

PowerShell says "execution of scripts is disabled on this system."

http://sqlish.com/file-ps1-cannot-be-loaded-because-the-execution-of-scripts-is-disabled-on-this-system-please-see-get-help-about_signing-for-more-details/

I changed execution policy,

enter image description here

But I allways get the same error.

1
3
5/23/2017 12:18:20 PM

Accepted Answer

It's possible that you changed the execution policy for 64-bit powershell and the package manager is running 32-bit (or vice versa).

I'd try opening 32-bit console (PowerShell (x86)) and setting the execution policy there, as the error is definitely pointing to that kind of resolution.

6
9/30/2013 6:52:43 PM

Popular Answer

Make sure you restart visual studio after changing execution policy so that changes can take effect. Also make sure you changed execution policy globally with administrator username and password.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow