Home » PowerShell » Get a List of Package Providers in PowerShell

Get a List of Package Providers in PowerShell

The PowerShell command to get a list of package providers in PowerShell is `Get-PackageProvider`. This command returns a list of packages that are connected to Package Management.

Here is the PowerShell command to list package providers that are connected to PackageManagement.

Get-PackageProvider

The list of these package providers includes PSModule, Nuget, PowerShellGet, Chocolatey, etc…

In this article, we will discuss how to get a list of package providers on the computer, get all currently loaded package providers, and dynamically get a package provider.

How to Get a List of Package Providers in PowerShell

To get a list of package providers that are available on the local computer using PowerShell, use the Get-PackageProvider command with the ListAvailable parameter.

Get-PackageProvider -ListAvailable

In the above PowerShell script, the Get-PackageProvider command uses the ListAvailable parameter to get a list of all package providers that are available on the local computer.

The output of the above PowerShell script is given below.

List all available package providers
List all available package providers

How to Get All Currently Loaded Package Providers

You can use the Find-Package command in PowerShell to get a list of all package providers that are currently loaded on the local computer.

Get-PackageProvider

How to Dynamically Get a Package Provider

To dynamically get a package provider using PowerShell, use the Find-Package command and specify the name of the package.

Get-PackageProvider -Name "Chocolatey" -ForceBootstrap

In the above PowerShell script, the Get-PackageProvider command uses the Name parameter to specify the name of the package “Chocolatey“. It will automatically install the Chocolatey provider If your computer doesn’t have the Chocolatey provider installed.

Conclusion

I hope the above article on how to use the Get-PackageProvider command in PowerShell to get a list of all package providers on the local computer is helpful to you.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Related Links

Get-Package

Find-Package

Install-Package

Install Nuget Package

Get-PackageSource

Register-PackageSource