Get-PSRepository

PowerShell リポジトリを取得します。

構文

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

説明

コマンドレットは Get-PSRepository 、現在のユーザーに登録されている PowerShell モジュール リポジトリを取得します。

これは、Microsoft.PowerShell.PSResourceGet の コマンドレットのプロキシ コマンドレットGet-PSResourceRepositoryです。 詳細については、「 Get-PSResourceRepository」を参照してください。

例 1: すべてのモジュール リポジトリを取得する

Get-PSRepository

このコマンドは、現在のユーザーに登録されているすべてのモジュール リポジトリを取得します。

例 2: モジュール リポジトリを名前で取得する

Get-PSRepository -Name "*NuGet*"

このコマンドは、名前に NuGet を含むすべてのモジュール リポジトリを取得します。

例 3: モジュール リポジトリを取得し、出力を書式設定する

Get-PSRepository -Name "Local01" | Format-List * -Force

Name                      : local01
SourceLocation            : http://manikb-dev:8765/api/v2/
Trusted                   : True
Registered                : True
InstallationPolicy        : Trusted
PackageManagementProvider : NuGet
PublishLocation           : http://pattif-dev:8765/api/v2/package/
ScriptSourceLocation      : http://pattif-dev:8765/api/v2/artifacts/psscript
ScriptPublishLocation     : http://pattif-dev:8765/api/v2/package/
ProviderOptions           : {}

このコマンドは Local01 という名前のリポジトリを取得し、パイプライン演算子を使用してそのオブジェクトを Format-List コマンドレットに渡します。

パラメーター

-Name

取得するリポジトリの名前を指定します。

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

入力

String[]

出力

Object