Get-PSRepository
PowerShell リポジトリを取得します。
構文
Default (既定)
Get-PSRepository
[[-Name] <String[]>]
[<CommonParameters>]
説明
Get-PSRepository コマンドレットは、現在のユーザーに登録されている PowerShell モジュール リポジトリを取得します。
例
例 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[] |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
(All)
| 配置: | 0 |
| 必須: | False |
| パイプラインからの値: | False |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
CommonParameters
このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。