PowerShell Error: the execution of scripts is disabled on this system

When you run powershell scripts (.pl1), in Windows PowerShell console you may received following error.
File C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management 
Portal\Install\Scripts\Management_Install.ps1 cannot
be loaded because the
execution of scripts is disabled on this system. Please see "get-help
for more de
At line:1 char:25
.\Management_Install.ps1 <;;;<<< 1
CategoryInfo :
NotSpecified: (:) [], PSSecurityException
FullyQualifiedErrorId : RuntimeException


To fix this, run following command, in the console

set-executionpolicy unrestricted

On 64bit version of Windows 2008R2, also make sure to set this command for 64bit  PowertShell, which can be found in C:\Windows\SysWOW64\WindowsPowerShell\v1.0 

After you done, it is recommended to revert the setting by using

set-executionpolicy restricted
set-executionpolicy default


Popular posts from this blog

IIS 7.5: 401 Unauthorized Access Error (Keep prompting Username/password)

Calculating Elapsed Time Accurately (C#)

Connecting DB2/iSeries From .net Application