smo*_*sen 16 policy nuget visual-studio-2013
在VS2013中,当我尝试打开NuGet包管理器控制台时,我突然收到错误:
Windows PowerShell已成功更新您的执行策略,但该设置被更具体范围内定义的策略覆盖.
由于覆盖,您的shell将保留其当前有效的Unrestricted执行策略.键入"Get-ExecutionPolicy -List"以查看执行策略设置.有关详细信息,请参阅"Get-Help Set- ExecutionPolicy".
如果我在PowerShell提示符下运行'Get-ExecutionPolicy -List',我会得到以下结果:
Scope ExecutionPolicy
----- ---------------
MachinePolicy Unrestricted
UserPolicy Unrestricted
Process Unrestricted
CurrentUser RemoteSigned
LocalMachine Undefined
Run Code Online (Sandbox Code Playgroud)
不确定这是否正确,但在我的同事PC上,策略设置为:
Scope ExecutionPolicy
----- ---------------
MachinePolicy Unrestricted
UserPolicy Undefined
Process Unrestricted
CurrentUser RemoteSigned
LocalMachine Undefined
Run Code Online (Sandbox Code Playgroud)
猜猜问题是'UserPolicy'所以我试图执行以下命令:
Set-ExecutionPolicy Undefined -Scope UserPolicy
Run Code Online (Sandbox Code Playgroud)
这给了我错误信息:
Set-ExecutionPolicy:无法设置执行策略.必须通过组策略设置MachinePolicy或UserPolicy范围的执行策略.
不太清楚现在该做什么.任何帮助解决这个问题将不胜感激.
pba*_*bar 24
这似乎发生在加入域的工作站上,域的组策略包含特定的PowerShell ExecutionPolicy设置.
目前,请参阅此处提供的选项:https://powershellpanda.wordpress.com/2013/12/01/override-gpo-for-powershell-execution-policy/
就个人而言,我正在使用临时修复程序.暂时清除从我的域中下推的执行策略.(它当然会回来,但至少我现在可以继续工作,直到找到一个更永久的解决方案.)这是我使用的regedit脚本:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell]
"ExecutionPolicy"=-
Run Code Online (Sandbox Code Playgroud)
另见:https://github.com/NuGet/Home/issues/974#issuecomment-123410075
我认为这只是昨天发布的Visual Studio 2013 更新5的一个问题.顺便说一句,它也会影响Visual Studio 2015(RTM).
现在可以使用适当的nuget修复程序(对于VS2013和VS2015),按照以下帖子:https://github.com/NuGet/Home/issues/974#issuecomment-124774650
归档时间: |
|
查看次数: |
3653 次 |
最近记录: |