3

Today i've installed Visual Studio 2015 and .Net 4.6 on my Win7 machine.

After starting Visual Studio 2013 and 2015, the package manager console gives the following error:

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."

And nothing can be entered in the console.

I tried to change the policy, but nothing changed. My current Policy:

For x86 and x64

                         Scope                                             ExecutionPolicy
                         -----                                             ---------------
                 MachinePolicy                                                Unrestricted
                    UserPolicy                                                Unrestricted
                       Process                                                   Undefined
                   CurrentUser                                                   AllSigned
                  LocalMachine                                                   AllSigned

How can I fix this, so i can use the Package Manager Console?

WebStar Venlo
  • 51
  • 1
  • 3
  • 2
    Same thing here, I did not even install VS15 bot just a VS13 component update. EDIT: http://stackoverflow.com/a/31560200/907512 worked for me. Deleting that key makes it work again. – FrankyBoy Jul 22 '15 at 15:11
  • This workaround does not solve the problem, the issue is reported at NuGet https://github.com/NuGet/Home/issues/974 – WebStar Venlo Jul 23 '15 at 11:42
  • weird, for me it does work, though it seems like the key is recreated (though I don't know based on what), had to delete it again today. – FrankyBoy Jul 23 '15 at 14:22

2 Answers2

2

There is a hotfix available, download links available. This week they also become available on Visual Studio gallery

https://github.com/NuGet/Home/issues/974#issuecomment-124774650

WebStar Venlo
  • 51
  • 1
  • 3
  • 1
    Note that there is also a workaround documented in the release: http://blog.nuget.org/20150720/nuget-3.0.0.html – Gilthans Oct 25 '16 at 14:15
0

The workaround at https://blog.nuget.org/20150720/nuget-3.0.0.html worked — temporarily — for me:

Delete the registry key at: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell

The effect seems to be the same as Set-ExecutionPolicy Undefined -scope MachinePolicy

so that was a little invasive. Plus I think it was reverted next time I opened a PowerShell console.

Chris F Carroll
  • 11,146
  • 3
  • 53
  • 61