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

This blog post will explore different methods to text someone anonymously, ensuring your identity remains hidden. In the digital age,...
This blog post will guide you through the process of locking a Discord channel on both desktop and mobile platforms.Discord,...
In the age of social media, managing your online presence has become crucial. Facebook, with its vast user base, is...