When I tried to make the change on my Windows Powershell profile, the changes didn’t take effect. Instead I’ve got the following error :
According to Technet, the error is due to Execution policy of the computer. Microsoft set it restricted by default. Basically you are not allowed to execute any other script except those signed by Microsoft. This is to keep script-kiddie hackers at bay.
If you’re sure you don’t mind the risk, here are the steps to enable Powershell to be able to run any script.
First you need to run it as Administrator. You can do it by right-click on Powershell icon and choose Run as Administrator.
Then you can check your current policy status by typing “Get-ExecutionPolicy”. If you see it Restricted, then you can proceed to the next step.
Type “Set-Executionpolicy -ExecutionPolicy Unrestricted”
When it asks you “Do you want to change the execution policy?” Just choose Yes by typing Y or simply pressing Enter key.
This is it! Now you can Run any script you want in Windows Powershell.
Source : Technet