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
コマンドレットの実行前に確認を求めるメッセージが表示されます。
型: | SwitchParameter |
Aliases: | cf |
配置: | Named |
規定値: | False |
必須: | False |
パイプライン入力を受け取る: | False |
ワイルドカード文字を受け取る: | False |
-Name
削除する 1 つ以上のリポジトリの名前。
型: | String[] |
配置: | 0 |
規定値: | None |
必須: | True |
パイプライン入力を受け取る: | True |
ワイルドカード文字を受け取る: | False |
-PassThru
指定すると、削除された各リポジトリの PSRepositoryInfo オブジェクトが出力されます。
型: | SwitchParameter |
配置: | Named |
規定値: | False |
必須: | False |
パイプライン入力を受け取る: | False |
ワイルドカード文字を受け取る: | False |
-WhatIf
コマンドレットの実行時に発生する内容を示します。 コマンドレットは実行されません。
型: | SwitchParameter |
Aliases: | wi |
配置: | Named |
規定値: | False |
必須: | False |
パイプライン入力を受け取る: | False |
ワイルドカード文字を受け取る: | False |
入力
String[]
出力
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo
既定では、コマンドレットはオブジェクトを返しません。 PassThru パラメーターを使用すると、コマンドレットは削除された各リポジトリの PSRepositoryInfo オブジェクトを出力します。
関連リンク
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
PSResourceGet