PentiaLabs / generator-helix

Generate Helix compliant solutions with Yeoman.
MIT License
40 stars 22 forks source link

Execution Policies add-project.ps1 cannot be loaded because running scripts is disabled on this system #49

Closed jimmierindal closed 7 years ago

jimmierindal commented 7 years ago

External developer tells:

When I am adding a project to a solution through the helix generator, im met by this error

Error: C:\Users\xxx\AppData\Roaming\npm\node_modules\generator-helix\powershell\add-project.ps1 : File C:\Users\xxx\AppData\Roaming\npm\node_modules\generator-helix\powersh
ell\add-project.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?Li

Error: nkID=135170.
At line:1 char:1

I would expect to be notified about whether or not i have to run the generator in a special execution policy state. Im not, and the script execution fails.

Saturate commented 7 years ago

Could you try to run Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force in a Powershell with admin rights?

If this works this should be added to the readme.

teltploek commented 7 years ago

In my opinion this is not a bug per se. It's probably in the category of an enhancement to docs.

jimmierindal commented 7 years ago

Setting the execution policy helped as expected.. Agree, its not a bug, but It Just needs to be clearified whats the best way to deal with it..

teltploek commented 7 years ago

I totally agree. We will make an instruction on this, and I appreciate your report on it. It's issues like this that can help us prepare the tool for broad user consumption 👍