Thursday, December 15, 2011

Enabling scripts in Windows PowerShell

Ok, so you've written your own script and now you want to run it to make sure that everything works fine. So you load up Powershell and try to run it but it gives you an error saying that the "execution of scripts is disabled" on your system. Now that's not very nice. But its ok, its very easy to fix.

First load up powershell as an administrator. Then type in

Get-Executionpolicy

What is should return is a value of Restricted

Now type in

Set-Executionpolicy unrestricted

And that's it. You can type in the get-executionpolicy again just to make sure but you should now have the ability to run scripts.