When I try to install Json from NuGet in Visual Studio 2015, I get the following:

Failed to initialize PowerShell node. If the AllSigned mode is selected for the PowerShell execution policy, open the package manager console to initialize the node first

OC Windows 10 Home 64 bit.

  • Well, restart Studio. If it does not help, restart the OS. - VladD
  • Restarting does not help. - Depth
  • Vs runs under admin? - Igor
  • Yes, under the administrator - Depth

5 answers 5

You need to run PowerShell (as an administrator) and run the command:

Set-ExecutionPolicy RemoteSigned 

There will be a warning:

Execution policy protects the computer from unreliable scripts. Changing the execution policy may jeopardize system security, blah blah ...

Confirm execution and restart Visual Studio

  • In my case, it did not help. - R. Matveev

Faced the same problem.

In my case, when I opened the npm console, I saw the npm initialization error message. There was approximately the following:

Nuget Package Manager requires PowerShell 2.0 to be installed. Please follow the link to get PowerShell 2.0.

The link leads to the microsoft website, where you can download PowerShell for Windows versions up to 7.

In Windows 8-10, PowerShell 2.0 is a component of the system; it is located in Windows Features .

After I turned on PS 2.0 and rebooted the studio, the problem was solved.

    The same error appeared when creating Visual Studio 2017 web applications (C #) on Windows 10. Reboot did not help. Set-ExecutionPolicy RemoteSigned - did not help. I updated (installed) to the latest version of Microsoft SQL Server from the official site and it all worked.

      There is something to do with PowerShell (64bit) and VS (32bit). It turns out (as I understand it), NuGet uses a 32-bit PowerShell console, and we need to use 64-bit (on the system). Therefore, you need to configure the security policy (or something like that) in PowerShell and connect 64-bit as 32-bit.

      What should be done (by the way, rebooting the system also helps):

      1. Open Windows PowerShell , run as administrator.

      2. In the PowerShell console, run the following script:

         start-job { Set-ExecutionPolicy RemoteSigned } -RunAs32 | wait-job | Receive-Job 
      3. Restart Visual Studio.

      • It is not necessary to find out which console he uses. You can change the ExecutionPolicy for both PS bit depths. - R. Matveev

      It is necessary that the project lay on the same disk as the studio. I do not know how it is connected, but it helped me.