PowerShell: Execution of scripts is disabled on this system.

Posted by

This error occur when the default PowerShell execution policy is active on the system, the default policy is restricted on fresh Windows Installations. Windows Execution policy is a security mechanism from Microsoft to protect your system against running unwanted PowerShell scripts on your system. But not handy for system administrators like us. To disable this security and enabling the possibility of running PowerShell scripts you can run a simple PowerShell command.

As described in the Help file of command: Get-ExecutionPolicy

* The execution policy is part of the security strategy of Windows PowerShell. It determines whether you can load configuration files (including your Windows PowerShell profile) and run scripts, and it determines which scripts, if any, must be digitally signed before they will run.

The effective execution policy is determined by the policies that you set by using the Set-ExecutionPolicy cmdlet and the “Turn on Script Execution” group policies for computers and users. The precedence order is ComputerGroup Policy > User Group Policy > Process (session) execution policy > User execution policy > Computer execution policy. For more information about Windows PowerShell execution policy, including definitions of the Windows PowerShellpolicies, see about_Execution_Policies

See about_Execution_Policies (http://go.microsoft.com/fwlink/?LinkID=135170).
Personally I use the following command, because I can read scripts and see if they are OK:

If you want some kind of security and run only scripts from trusted publishers.

Leave a Reply

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