次の方法で共有


Get-PSRepository

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

構文

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

説明

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

これは、Microsoft.PowerShell.PSResourceGetGet-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

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

型:String[]
配置:0
規定値:None
必須:False
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

入力

String[]

出力

Object