Edit

Share via


Get-PSResourceRepository

Finds and returns registered repository information.

Syntax

Default (Default)

Get-PSResourceRepository
    [[-Name] <String[]>]
    [<CommonParameters>]

Description

This cmdlet searches for PowerShell resource repositories that are registered on the machine. By default, it returns all registered repositories.

Examples

Example 1

This example returns all the repositories registered on the machine.

Get-PSResourceRepository
Name             Uri                                          Trusted   Priority
----             ---                                          -------   --------
PoshTestGallery  https://www.poshtestgallery.com/api/v2          True         40
PSGallery        https://www.powershellgallery.com/api/v2       False         50
psgettestlocal   file:///c:/code/testdir                         True         50

Example 2

This example uses the Name parameter to get a specific repository.

Get-PSResourceRepository -Name PSGallery
Name         Uri                                        Trusted   Priority
----         ---                                        -------   --------
PSGallery    https://www.powershellgallery.com/api/v2     False         50

Example 3

This example uses the Name parameter to get all repositories that end with Gallery.

Get-PSResourceRepository -Name "*Gallery"
Name             Uri                                          Trusted   Priority
----             ---                                          -------   --------
PoshTestGallery  https://www.poshtestgallery.com/api/v2          True         40
PSGallery        https://www.powershellgallery.com/api/v2       False         50

Example 4

This example uses the Name parameter to get a list of named respositories.

Get-PSResourceRepository -Name "PSGallery","PoshTestGallery"
Name             Uri                                          Trusted   Priority
----             ---                                          -------   --------
PoshTestGallery  https://www.poshtestgallery.com/api/v2          True         40
PSGallery        https://www.powershellgallery.com/api/v2       False         50

Parameters

-Name

The name of the repository to search for. Wildcards are supported. Tab completion for this parameter cycles through the registered repository names.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo