PowerShell script cannot be loaded because running scripts is disabled on this system.

When you run a PowerShell script in the PowerShell terminal for the first time , sometimes you might get the below error.

image

File <Path>.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecord
Exception
+ FullyQualifiedErrorId : UnauthorizedAccess

 

In order to fix this error , you need to enable or activate PowerShell on your system.

Follow the below steps to activate or enable the PowerShell on your system.

1. Run PowerShell terminal in administrator mode (Elevated mode).

2. Execute the following command
set-executionpolicy remotesigned

3. Type Y for Yes and press the enter key.

4. Now , you should able to run PowerShell scripts in the PowerShell terminal.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

When testing your app in the Windows Phone 8 Emulator, the developers may want to see how the application behaves...
If you are looking out for different ways to right click on Mac , here are some of the ways...
The holiday season is a time for joy, family gatherings, and unfortunately, a notable increase in scams. As Christmas approaches,...