2011-06-14 125 views
0

我试图安装的NuGet包,比如统一或的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 

我怎样才能解决这个问题?在此先感谢;)

+0

你使用的是什么版本的NuGet?尝试升级到最新版本。听起来像这个问题:http://nuget.codeplex.com/workitem/834 – PHeiberg 2011-06-15 07:54:20

+0

我的NuGet版本是1.3.20419.9007,我已经将PowerShell ExecutionPolicy更改为Unrestricted。但是我的问题还没有解决! – Sadegh 2011-06-15 14:41:38

+0

注意:我用管理员帐户测试过这个问题,一切都找到了,但我在我自己的帐户(Sadegh)中有这个问题但是这个帐户也在Admonistrators下! – Sadegh 2011-06-15 14:44:00

回答

1

目前老版的NuGet又名不> 1.4不签PowerShell脚本,因此你需要运行从PowerShell命令行:

set-executionpolicy Unrestricted 

在1.4,我们要签署的脚本,所以你不应该有这个问题。虽然1.4还没有发货,但很快:)

如果您的管理员已经锁定了PowerShell脚本,那么您可以要求他们为您做这个或等到NuGet 1.4发布。

+0

我是管理员!现在我该如何解锁PowerShell才能够执行PS脚本? – Sadegh 2011-06-15 19:32:06

+0

只要打开Powershell 2命令窗口应该是你的开始菜单中的链接并键入上面的命令(Set-Execution等等等等) – 2011-06-15 19:54:23

+0

1.4或最新版本可以从源代码构建:http://nuget.codeplex.com/SourceControl/list/changesets – PHeiberg 2011-06-16 07:10:03