When you write a powershell script on your own, or download scripts from the Internet you will not be able to execute them on your computer. This is by design and implementation of PowerShell in Windows. To overcome this, you can run PowerShell as an Administrator, or

  1. Start PowerShell as an Administrator
  2. Execute the following command:
    1. Answer “Y” and you should get a following output

After executing above command, you will be able to run unsigned scripts written on you local computer. In addition you will be able to run signed scripts from the Internet.
More info about running PowerShell scripts here