Ramos
Ramos

Reputation: 13

Can't install nuget package because of “Failed to initialize the PowerShell host”

Can't install nuget package because of “Failed to initialize the PowerShell host” This is the Error The following error occurred while loading the extended type data file: , C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\2ZQ00DAJ.XOI\Modules\NuGet\NuGet.Types.ps1xml: The file was skipped because of the following validation exception: File C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\2ZQ00DAJ.XOI\Modules\NuGet\NuGet.Types.ps1xml cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy..

Upvotes: 0

Views: 961

Answers (1)

Petar Marinković
Petar Marinković

Reputation: 126

Since you're using VS 2015 x86, you should start a 32bit version of PowerShell/PowerShell ISE as Administrator (won't work if you just' start it without elevated rights, will give you an error) and change ExecutionPolicy to RemoteSigned, like this

Set-ExecutionPolicy RemoteSigned

and after, restart your Visual Studio. Personally, I don't have it here to test, but think this will fix the error you're getting.

Upvotes: -1

Related Questions