Import-Certificate

Import-Certificate

Imports one or more certificates into a certificate store.

構文

Parameter Set: Default
Import-Certificate [-FilePath] <String> [-CertStoreLocation <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Import-Certificate cmdlet imports one or more certificates into a certificate store.

パラメーター

-CertStoreLocation<String>

Specifies the path to the certificate store where the certificates will be imported. If the path to the certificate store is not specified, then the current store is used.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-FilePath<String>

Specifies the path to a certificate file to be imported. Acceptable formats include .sst, .p7b, and .cert files. If the file contains multiple certificates, then each certificate will be imported to the destination store.

Aliases

FullName

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

true (ByPropertyName)

ワイルドカード文字の受け入れ

false

-Confirm

コマンドレットを実行する前に確認メッセージを表示します。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-WhatIf

コマンドレットが実行された場合に何が起きるのかを示します。コマンドレットは実行されません。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

<CommonParameters>

このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • System.String

    A String containing the file path.

出力

出力型は、コマンドレットが出力するオブジェクトの型です。

  • System.Security.Cryptography.X509Certificates.X509Certificate2[]

    The output is an array of X509Certificate2[] objects.

使用例

EXAMPLE 1

This example imports the certificate from the file into the root store of the current user.

PS C:\> $file = ( Get-ChildItem -Path C:\files\root.cer )
PS C:\> $file | Import-Certificate -CertStoreLocation cert:\CurrentUser\Root

EXAMPLE 2

This example imports the certificate from the file into the current store.

PS C:\> Set-Location -Path cert:\CurrentUser\My
PS C:\> Import-Certificate -Filepath "C:\files\intermediate.cert"

関連項目

Export-Certificate

Get-ChildItem

Set-Location