I have a computer behind a proxy and trying to get the Nuget package provider installed. I ran Install-PackageProvider -Name Nuget on a different PC on a different network and copied Nuget folder to $env:ProgramFiles\PackageManagement\ProviderAssemblies.
If I run Get-PackageProvider -ListAvailable it shows Nuget available.
However when I try to run Import-PackageProvider -Name Nuget I get the following error:
PS C:\Windows\system32> Import-PackageProvider -Name Nuget
Import-PackageProvider : No match was found for the specified search criteria and provider name ‘Nuget’. Try ‘Get-PackageProvider -ListAvailable’ to see if the provider exists on the system.At line:1 char:1
Add -verbose and post the results. I had something similar and the verbose was showing that I was having issues reaching newget.org Our company uses OpenDNS and the site had been classified as “dynamic” and was blocked.
The PackageManagement code is a bit tricky to follow in ILSpy, but you might try using a full path to the DLL when calling Import-PackageProvider, to see if there’s any difference:
I never figured out issues with Import-PackageProvider however I was able to get Henry’s solution to work for me. I had to also add the the proxy address because we use a configuration file to redirect traffic, so that was another hour of troubleshooting.