安装NuGet包时出现问题

时间:2011-06-14 18:49:21

标签: nuget nuget-package

我正在尝试安装像Unity或EntityFramework这样的NuGet包,但在下载后Nuget无法安装那些并返回此错误消息:

Your machine group policy or user group policy disables execution of PowerShell script.
Adjust your group policy settings to allow execution of PowerShell scripts

如何解决此问题?在此先感谢;)

1 个答案:

答案 0 :(得分:1)

目前旧版的NuGet aka not> 1.4不要签署powershell脚本,因此您需要从powershell命令行运行以下命令:

set-executionpolicy Unrestricted
在1.4中我们将签署脚本,所以你不应该有这个问题。虽然1.4尚未发货,但很快就会发货:)

如果您的管理员已经锁定了PowerShell脚本,则上述修复可能会失败,在这种情况下您可以要求他们为您执行此操作,或者等到NuGet 1.4发布。