By default in server 2012 running scripts in Powershell is disabled. This is done for security reasons.
Launch Powershell and put in the following command:
The available options are:
- Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode. Default setting on new installs.
- AllSigned – Only scripts signed by a trusted publisher can be run. This means if you write a local script it needs to be signed.
- RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run. Local scripts can run unsigned.
- Unrestricted – No restrictions; all Windows PowerShell scripts can be run. “The Easy Button”.
I prefer the RemoteSigned option. This keeps my server moderately safe and doesn’t cause headaches when I create a local script. Read more on Microsoft’s TechNet Article for Set-ExecutionPolicy