Reputation: 51
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?
Upvotes: 3
Views: 5744
Reputation: 12378
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.
Upvotes: 0
Reputation: 51
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
Upvotes: 2