To register a package source for a specified package provider, use the Register-PackageSource
command in PowerShell.
Here, is the PowerShell command to add package source in PowerShell.
Register-PackageSource -Name <name of package source> -Location <web based location>
In this article, we will discuss how to register a package source for a specified package provider in PowerShell.
How to Add a Package Source in PowerShell
The command to add a package source for a specified package provider is Register-PackageSource
. Package sources are always managed by a package provider.
Register-PackageSource -Name MyNuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
In the above PowerShell script, the Register-PackageSource
command uses the Name
parameter to specify the name MyNuGet and the web-based Location for the NuGet provider.
The output of the above PowerShell script adds a package source for the NuGet provider on the local computer.
Register-PackageSource -Name MyNuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
Name ProviderName IsTrusted Location
---- ------------ --------- --------
MyNuGet NuGet False https://www.nuget.org/api/v2
Conclusion
I hope the above article on how to register a package source for the specific provider using the PowerShell Register-PackageSource
command is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.