Get-PackageSource

Gets a list of package sources that are registered for a package provider.
Get-PackageSource [[-Name] [<String>]] [-Force] [-ForceBootstrap] [-Location [<String>]][-PackageManagementProvider [<String>]] [-ProviderName {Programs | msi | msu | PowerShellGet | nuget |chocolatey}] [-PublishLocation [<String>]] [-ScriptPublishLocation [<String>]] [-ScriptSourceLocation [<String>]][-Type {Module | Script | All}] [<CommonParameters>]

The Get-PackageSource gets a list of package sources that are registered with Package Management on the local computer. If you specify a package provider, Get-PackageSource gets only those sources that are associated with the specified provider. Otherwise, the command returns all package sources that are registered with Package Management.

Parameters
-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-ForceBootstrap [<SwitchParameter>]

Indicates that this cmdlet forces Package Management to automatically install the package provider.

-Location [<String>]

Specifies the location of the Package Management source or repository.

-Name [<String>]

Specifies the name of the Package Management source.

-PackageManagementProvider [<String>]

Specifies the Package Management provider.

-ProviderName [<String[]>]

Specifies the provider name. The acceptable values for this parameter are:

— msi– msu– PowerShellGet– nuget– chocolatey

-PublishLocation [<String>]

Specifies the publish location for the package source.

-ScriptPublishLocation [<String>]

Specifies the script publish location.

-ScriptSourceLocation [<String>]

Specifies the script source location.

-Type [<String>]

Specifies whether to search for packages with a module, a script, or either. The acceptable values for this parameter are:

— Module– Script– All

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Outputs

PackageSource[]

Specifies one or more package sources.

Examples
  1. Get all package sources:
    PS C:> Get-PackageSource
    

    This command gets all package sources that are registered with Package Management on the local computer.

  2. Get all package sources for a specific provider:
    PS C:> Get-PackageSource -ProviderName "PSModule"
    

    This command gets all package sources that are registered for the PSModule provider.

  3. Get all package sources for a specific provider:
    PS C:> Get-PackageProvider "PSModule" | Get-PackageSource
    

    This command gets all package sources for the PSModule provider by piping the results of the Get-PackageProvider cmdlet to Get-PackageSource.

Related Links

Register-PackageSource
Set-PackageSource
Unregister-PackageSource