Get-PSResourceRepository

查找并返回已注册的存储库信息。

语法

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

说明

此 cmdlet 搜索在计算机上注册的 PowerShell 资源存储库。 默认情况下,它返回所有已注册的存储库。

示例

示例 1

此示例返回在计算机上注册的所有存储库。

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

示例 2

此示例使用 Name 参数获取特定的存储库。

Get-PSResourceRepository -Name PSGallery

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

示例 3

此示例使用 Name 参数获取以 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

示例 4

此示例使用 Name 参数获取命名存储库的列表。

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

参数

-Name

要搜索的存储库的名称。 支持通配符。 此参数的 Tab 自动补全将循环访问已注册的存储库名称。

Type:String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

输入

String[]

输出

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo