In this Azure tutorial, we will discuss how to fix the error, Unable to find package providers (NuGet), which comes while trying to install the PowerShell Nuget and Azure PowerShell module using PowerShell ISE.
Unable to find package providers (NuGet)
Recently, while I was trying to install PowerShell NuGet, I got this error. I was executing the PowerShell script to install PowerShell NuGet and got this error.
When I tried to install the ‘Nuget’ package using the PowerShell cmdlet below, I got the above error.
I was executing the following line of code to install NuGet PowerShell.
$_nugetUrl = "https://api.nuget.org/v3/index.json"
$MypS = Get-PackageSource
if(@($MypS).Where{$_.location -eq $_nugetUrl}.count -eq 0)
{
Register-PackageSource -Name MyNuGet -Location $_nugetUrl -ProviderName NuGet
}I got the following error: see below ,Powershell not able to access “NuGet” package

Why are we getting this error, and what is the solution to this error?
The first step is to verify the version of the Transport Layer Security protocols using the following PowerShell cmdlet.
PS C:\WINDOWS\system32> [Net.ServicePointManager]::SecurityProtocolOnce you run the above PowerShell cmdlet, you can see the version of Transport Layer Security protocols available on your system. If the versions are very old and even deprecated, you need to enable the latest version.
Solution
Install-PackageProvider
To fix the, Unable to install NuGet provider error in PowerShell, we need to follow the steps below to fix the Unable to find package provider ‘NuGet’ issue.
1. Open PowerShell as run as Administrator.
2. Run the below command to enable TLS 1.2, or you can also enable TLS 1.3 or even any higher versions.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12or
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls133. Run the below command
Install-PackageProvider -Name NuGetSee the output here. This time, I can successfully install the NuGet package provider without any issue. Check out the screenshot below for your reference.

This is how I install the NuGet Provider for PowerShell without any issue.
Conclusion
In this article, we learned how to fix the error “Unable to find package providers (NuGet).” Now, you can install NuGet for PowerShell without any issues.
You may like the following Azure tutorials:
- The ‘New-AzResourceGroup’ command was found in the module ‘Az.Resources’, but the module could not be loaded
- How to Create an Azure Free Account (Step-by-Step tutorial)
- The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell
I am Bijay, a Microsoft MVP (10 times) having more than 17 years of experience in the software industry. During my IT career, I got a chance to share my expertise in SharePoint and Microsoft Azure, like Azure VM, Azure Active Directory, Azure PowerShell, etc. I hope you will learn from these Azure tutorials. Read more
