今天,我已经在我的Win7机器上安装了Visual Studio2015和.Net 4.6。
启动Visual Studio 2013和2015后,包管理器控制台显示以下错误:
Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of "Unrestricted". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPolicy."并且在控制台中不能输入任何内容。
我试着改变政策,但什么也没改变。我当前的政策:
对于x86和x64
Scope ExecutionPolicy
----- ---------------
MachinePolicy Unrestricted
UserPolicy Unrestricted
Process Undefined
CurrentUser AllSigned
LocalMachine AllSigned我如何解决这个问题,这样我才能使用Package Manager控制台?
发布于 2015-07-27 14:39:06
有一个热修复程序,下载链接可用。本周,它们也可以在Visual Studio图库中使用
https://github.com/NuGet/Home/issues/974#issuecomment-124774650
发布于 2017-10-09 21:42:42
https://blog.nuget.org/20150720/nuget-3.0.0.html的变通方法对我来说是暂时有效的:
在以下位置删除注册表项: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell
效果看起来和Set-ExecutionPolicy Undefined -scope MachinePolicy一样
所以这有点侵入性。另外,我认为它在我下次打开PowerShell控制台时被恢复了。
https://stackoverflow.com/questions/31559163
复制相似问题