SQL SERVER – Fix: Error: File cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details

Yesterday I formatted my computer and did fresh install as it was due from long time. After the fresh install when I tried to install Semantic Search application using powershell, I was stopped by following error.

File cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details

Fix/Solution/Workaround:

The solution is very simple. Open the Powershell window and type following two lines and everything will fine right after that.

Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy RemoteSigned

Again, this is I have done for my environment where I am very careful what I will run. You can change the policy back to original restricted policy if you want to restrict future execution of the powershell scripts.

Simple – isn’t it? Well all complex looking problems are very simple to solve.

Hey Dave, Your blog is awesome. :)
For running scripts in powershell you only need one of the set-executionpolicy statements. Running the second one overwrites the first.
Try:
set-executionpolicy unrestricted
get-executionpolicy
set-exectuionpolicy remotesigned
get-executionpolicy
set-executionpolicy restricted
get-executionpolicy
you will see they overwrite.

Both will work to run scripts.
set-executionpolicy unrestricted will allow all to run
set-exectuionpolicy remotesigned will allow all local scripts to run but require remote scripts to be signed.
set-exectuionpoliciy restricted allows none.

Community Initiatives

About Pinal Dave

Pinal Dave is a Pluralsight Developer Evangelist. He has authored 11 SQL Server database books, 17 Pluralsight courses and have written over 3200 articles on the database technology on his blog at a http://blog.sqlauthority.com. Along with 11+ years of hands on experience he holds a Masters of Science degree and a number of certifications, including MCTS, MCDBA and MCAD (.NET). His past work experiences include Technology Evangelist at Microsoft and Sr. Consultant at SolidQ. Follow @pinaldave
Send Author Pinal Dave
an email at pinal@sqlauthority.com

Email Subscription

Enter your email address to subscribe to this blog and receive notifications of new posts by email.