By default and for obvious security reasons the default execution policy of Powershell scripts is “Restricted”.
With this kind of mode you can run individual cmdlets but not saved Powershell scripts.
If you want to change this policy, you can run the following command:
Set-ExecutionPolicy <PolicyMode>
Here below the different <PolicyMode> you can define:
Important: do not forget to run as Administrator your powershell console with Vista,7/2008/2008R2….because of UAC restrictions as this command modifies the registry and ExecutionPolicy is stored in the HKLM registry hive.
Vincent