Get-Package Source

Gets a list of package sources that are registered for a package provider.

Syntax

Get-PackageSource
   [[-Name] <String>]
   [-Location <String>]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-ConfigFile <String>]
   [-SkipValidate]
   [<CommonParameters>]
Get-PackageSource
   [[-Name] <String>]
   [-Location <String>]
   [-Force]
   [-ForceBootstrap]
   [-ProviderName <String[]>]
   [-PackageManagementProvider <String>]
   [-PublishLocation <String>]
   [-ScriptSourceLocation <String>]
   [-ScriptPublishLocation <String>]
   [<CommonParameters>]

Description

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.

Examples

Example 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.

Example 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.

Example 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 .

Optional Parameters

-ConfigFile

{{Fill ConfigFile Description}}

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ForceBootstrap

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

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Location

Specifies the location of the Package Management source or repository.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name

Specifies the name of the Package Management source.

Type: String
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PackageManagementProvider

Specifies the Package Management provider.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProviderName

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

  • msi
  • msu
  • PowerShellGet
  • nuget
  • chocolatey
Type: String[]
Aliases: Provider
Parameter Sets: Programs, msi, msu, PowerShellGet, nuget, chocolatey
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-PublishLocation

Specifies the publish location for the package source.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptPublishLocation

Specifies the script publish location.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptSourceLocation

Specifies the script source location.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SkipValidate

{{Fill SkipValidate Description}}

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Outputs

PackageSource[]

Specifies one or more package sources.