Share via


Unregister-PSResourceRepository

登録済みのリポジトリをローカル コンピューターから削除します。

構文

Unregister-PSResourceRepository
          [-Name] <String[]>
          [-PassThru]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]

説明

コマンドレットは、登録されているリポジトリをローカル コンピューターから削除します。

例 1

この例では、 PSGv3 ローカル コンピューターからリポジトリを削除します。

Get-PSResourceRepository

Name      Uri                                      Trusted Priority
----      ---                                      ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True    10
Local     file:///D:/PSRepoLocal/                  True    20
PSGv3     https://www.powershellgallery.com/api/v3 True    50

Unregister-PSResourceRepository -Name PSGv3
Get-PSResourceRepository

Name      Uri                                      Trusted Priority
----      ---                                      ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True    10
Local     file:///D:/PSRepoLocal/                  True    20

例 2

この例では、1 つのコマンドで複数の登録済みリポジトリを削除する方法を示します。 Name パラメーターは、削除するリポジトリの名前を含む配列を受け取ります。

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

Unregister-PSResourceRepository -Name PoshTestGallery, psgettestlocal
Get-PSResourceRepository

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

パラメーター

-Confirm

コマンドレットの実行前に確認を求めるメッセージが表示されます。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

削除する 1 つ以上のリポジトリの名前。

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

-PassThru

指定すると、削除された各リポジトリの PSRepositoryInfo オブジェクトが出力されます。

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

-WhatIf

コマンドレットの実行時に発生する内容を示します。 コマンドレットは実行されません。

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

入力

String[]

出力

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo

既定では、コマンドレットはオブジェクトを返しません。 PassThru パラメーターを使用すると、コマンドレットは削除された各リポジトリの PSRepositoryInfo オブジェクトを出力します。