Tried to execute a PowerShell script in one of my test server (windows server 2008 R2) and got an error saying Execution of scripts is disabled on this system.
Note : Basically this policy helps you to prevent untrusted scripts which can be affected to Production/critical environments. you may revert back to default once you done with your scripts if it is and critical server on production in order to prevent untrusted affections.
Running below line on PowerShell fixed the point and PowerShell was back to work.
- Set-ExecutionPolicy Unrestricted
- Type ‘Y’ and Enter to agree and proceed
Note : Run below line to revert back the policy setting to default.
Set-ExecutionPolicy Restricted