Answers

Did you run the powsershell with Administrator account?
Did you have the developer license?

If you launched the script directly from PowerShell instead of by using the shortcut menu, no warning will appear about the risks of changing your execution, and the script will fail. To work around this issue, change the execution policy manually and then
run the script again.