SOVLED! “Unable To Find Package Provider NuGet”

On Windows, the obsolescence of PackageManagement is usually responsible for the “Unable to find package provider NuGet” error during the use of PowerShellGet cmdlets. In most of the cases, the best solution is to update PackageManagement. Besides that, you could change the TLS version to 1.2 as well. Continue reading to be able to fix the error and use PowerShellGet cmdlets as you see fit. 

The Number One Suspect: PackageManagement

In case you don’t know, PackageManagement gets updated from time to time. Needless to say, if you neglect PackageManagement updates, it’s only natural for your version of PackageManagement to become obsolete. Obsolescence causes a wide range of errors and “Unable to find package provider NuGet” is a prime example. 

Approaches To The Situation

Update PackageManagement

  • Step 1: Go to Search bar, type PowerShell and hit Run as administrator. 
  • Step 2: In PowerShell (Admin), run the command Get-Module PowerShellGet, PackageManagement -ListAvailable and note down your version of PackageManagement.
  • Step 3: Launch your web browser, visit the PowerShell Gallery website and go to Packages. 
  • Step 4: Locate PackageManagent, click it and pick your version of PackageManagement.
  • Step 5: Navigate to Installation Options, select Manual Download and choose Download the nupkg file.
  • Step 6: Extract the zipped nupkg.
  • Step 7: Press Windows + E to open Windows Explorer then navigate to the PackageManagement directory (C:\Program Files\WindowsPowerShell\Modules\PackageManagement).
  • Step 8: Proceed to create a new folder, name it using your version of PackageManagement and put the extracted zipped nupkg inside. 
  • Step 9: Restart your computer.
  • Step 10: See how things turn out. 

Change TLS Version To 1.2

  • Step 1: Go to Search bar, type PowerShell and hit Run as administrator. 
  • Step 2: In PowerShell (Admin), run each of the commands down below:
    • [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    • [Net.ServicePointManager]::SecurityProtocol
  • Step 3: After you finish, restart your computer and determine whether the issue persists.

Other Questions About PowerShell

What is PowerShell and what is it used for?

PowerShell is a utility of Windows. By taking advantage of  PowerShell, Windows users could tweak aspects of the systems, automate tasks and so on. 

Is PowerShell the same as Command Prompt?

While Command Prompt and PowerShell share quite a few similarities, differences exist. For instance, Command Prompt operates with only batch commands while PowerShell operates with both batch commands and cmdlets. Also, PowerShell is based on .NETFramework so it could access programming libraries while Command Prompt is unable to access libraries.

What are common PowerShell commands?

There are many commands used to troubleshoot errors in Windows and one of the most common ones include:

  • Test-NetConnection: Shows diagnostic information for a connection.
  • Enter-PSSession: Starts an interactive session with a single remote computer. 
  • Get-Process: Gets the processes on a local or remote computer
  • Stop-Process: Kills one or more running processes.
  • Get-Command: Gets all commands that are installed on your system.
  • Export-CSV: Converts PowerShell objects into a CSV string.

What must be done if PowerShell is not running? 

Solution 1: Disable and re-enable PowerShell

  • Step 1: Go to Search bar, type Control Panel and press Enter.
  • Step 2: Change View by to Large icons, click Program & features and pick Turn Windows features on or off.
  • Step 3: Uncheck the checkbox beside Windows PowerShell, hit OK and restart your computer.
  • Step 4: When the screen comes back on, go to Turn Windows features on or off, check the Windows PowerShell checkbox and hit OK.
  • Step 5: Restart your computer. 

Solution 2: Use Task Manager

  • Step 1: Right-click an empty space on the taskbar then pick Task Manager.
  • Step 2: Choose File and select Run new task
  • Step 3: Type PowerShell, check the checkbox next to Create this task with administrative privileges then hit OK.

Solution 3: Reset Group Policy

  • Step 1: P Go to Search bar, type gpedit.msc and press Enter.
  • Step 2: Hit the arrow beside Computer Configuration then navigate to Administrative Templates/All Settings
  • Step 3: Hit State for the Enabled or Disabled policies to appear on top.
  • Step 4: Right-click each of the Enabled/Disabled policies, hit Not configured, select Apply and choose OK.
  • Step 5: Proceed to set all the policies to Not configured in User Configuration/Administrative Templates/All Settings.
  • Step 6: Restart your computer.

Solution 4: Switch Account

  • Step 1: Press Windows + L to get to the Lock screen.
  • Step 2: Select the new account, input the password then hit Enter.
  • Step 3: Launch PowerShell.

Leave a Comment