Skip to content

Commit e06c290

Browse files
committed
docs: Update Import-PfxCertificate documentation to include -ProtectPrivateKey parameter and example
1 parent ba351df commit e06c290

File tree

4 files changed

+134
-10
lines changed

4 files changed

+134
-10
lines changed

docset/winserver2016-ps/pki/Import-PfxCertificate.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Imports certificates and private keys from a Personal Information Exchange (PFX)
1616
## SYNTAX
1717

1818
```
19-
Import-PfxCertificate [-Exportable] [-Password <SecureString>] [[-CertStoreLocation] <String>]
20-
[-FilePath] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
19+
Import-PfxCertificate [-Exportable] [-ProtectPrivateKey <ProtectPrivateKeyType>] [-Password <SecureString>]
20+
[[-CertStoreLocation] <String>] [-FilePath] <String>
21+
[-WhatIf] [-Confirm] [<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -56,6 +57,15 @@ This example imports the PFX file mypfx.pfx into the My store for the machine ac
5657
The **Password** parameter is not required since this PFX file is protected using the domain account of this machine.
5758
This requires a Windows Server® 2012 domain controller.
5859

60+
### EXAMPLE 4
61+
```
62+
PS C:\>Get-ChildItem -Path c:\mypfx\my.pfx | Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My -ProtectPrivateKey vsm
63+
```
64+
65+
This example imports the PFX file `my.pfx` with a private key into the My store for the current user.
66+
The **Password** parameter is not required since this PFX file is not password protected.
67+
The private key will be protected by virtualized-based security (VBS) and cannot be exported.
68+
5969
## PARAMETERS
6070

6171
### -CertStoreLocation
@@ -105,6 +115,24 @@ Accept pipeline input: False
105115
Accept wildcard characters: False
106116
```
107117
118+
### -ProtectPrivateKey
119+
Specifies whether to protect the imported private key by virtualized-based security.
120+
If this parameter is specified with the value `vsm`, then the private key cannot be exported.
121+
Virtual Secure Mode (VSM) capabilities were introduced in Windows 10 and Windows Server 2016.
122+
123+
```yaml
124+
Type: Microsoft.CertificateServices.Commands.ProtectPrivateKeyType
125+
Parameter Sets: (All)
126+
Aliases:
127+
Accepted values: none, vsm
128+
129+
Required: False
130+
Position: Named
131+
Default value: None
132+
Accept pipeline input: False
133+
Accept wildcard characters: False
134+
```
135+
108136
### -FilePath
109137
Specifies the path for the PFX file.
110138

@@ -177,3 +205,5 @@ The imported **X509Certificate2** object contained in the PFX file that is assoc
177205
[Export-PfxCertificate](./Export-PfxCertificate.md)
178206

179207
[System Store Locations](/windows/desktop/seccrypto/system-store-locations)
208+
209+
[Virtualization-based Security](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs)

docset/winserver2019-ps/pki/Import-PfxCertificate.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Imports certificates and private keys from a Personal Information Exchange (PFX)
1616
## SYNTAX
1717

1818
```
19-
Import-PfxCertificate [-Exportable] [-Password <SecureString>] [[-CertStoreLocation] <String>]
20-
[-FilePath] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
19+
Import-PfxCertificate [-Exportable] [-ProtectPrivateKey <ProtectPrivateKeyType>] [-Password <SecureString>]
20+
[[-CertStoreLocation] <String>] [-FilePath] <String>
21+
[-WhatIf] [-Confirm] [<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -56,6 +57,15 @@ This example imports the PFX file mypfx.pfx into the My store for the machine ac
5657
The **Password** parameter is not required since this PFX file is protected using the domain account of this machine.
5758
This requires a Windows Server® 2012 domain controller.
5859

60+
### EXAMPLE 4
61+
```
62+
PS C:\>Get-ChildItem -Path c:\mypfx\my.pfx | Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My -ProtectPrivateKey vsm
63+
```
64+
65+
This example imports the PFX file `my.pfx` with a private key into the My store for the current user.
66+
The **Password** parameter is not required since this PFX file is not password protected.
67+
The private key will be protected by virtualized-based security (VBS) and cannot be exported.
68+
5969
## PARAMETERS
6070

6171
### -CertStoreLocation
@@ -105,6 +115,24 @@ Accept pipeline input: False
105115
Accept wildcard characters: False
106116
```
107117
118+
### -ProtectPrivateKey
119+
Specifies whether to protect the imported private key by virtualized-based security.
120+
If this parameter is specified with the value `vsm`, then the private key cannot be exported.
121+
Virtual Secure Mode (VSM) capabilities were introduced in Windows 10 and Windows Server 2016.
122+
123+
```yaml
124+
Type: Microsoft.CertificateServices.Commands.ProtectPrivateKeyType
125+
Parameter Sets: (All)
126+
Aliases:
127+
Accepted values: none, vsm
128+
129+
Required: False
130+
Position: Named
131+
Default value: None
132+
Accept pipeline input: False
133+
Accept wildcard characters: False
134+
```
135+
108136
### -FilePath
109137
Specifies the path for the PFX file.
110138

@@ -177,3 +205,5 @@ The imported **X509Certificate2** object contained in the PFX file that is assoc
177205
[Export-PfxCertificate](./Export-PfxCertificate.md)
178206

179207
[System Store Locations](/windows/desktop/seccrypto/system-store-locations)
208+
209+
[Virtualization-based Security](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs)

docset/winserver2022-ps/pki/Import-PfxCertificate.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ destination store.
1717
## SYNTAX
1818

1919
```
20-
Import-PfxCertificate [-Exportable] [-Password <SecureString>]
21-
[[-CertStoreLocation] <String>] [-FilePath] <String> [-WhatIf] [-Confirm]
22-
[<CommonParameters>]
20+
Import-PfxCertificate [-Exportable] [-ProtectPrivateKey <ProtectPrivateKeyType>] [-Password <SecureString>]
21+
[[-CertStoreLocation] <String>] [-FilePath] <String>
22+
[-WhatIf] [-Confirm] [<CommonParameters>]
2323
```
2424

2525
## DESCRIPTION
@@ -72,6 +72,17 @@ This example imports the PFX file `mypfx.pfx` into the My store for the machine
7272
**Password** parameter is not required since this PFX file is protected using the domain account of
7373
this machine. This requires a Windows Server 2012 or later domain controller.
7474

75+
### EXAMPLE 4
76+
77+
```powershell
78+
Get-ChildItem -Path C:\mypfx.pfx |
79+
Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My -ProtectPrivateKey vsm
80+
```
81+
82+
This example imports the PFX file `mypfx.pfx` with a private key into the My store for the current user.
83+
The **Password** parameter is not required since this PFX file is not password protected.
84+
The private key will be protected by virtualized-based security (VBS) and cannot be exported.
85+
7586
## PARAMETERS
7687

7788
### -CertStoreLocation
@@ -124,6 +135,25 @@ Accept pipeline input: False
124135
Accept wildcard characters: False
125136
```
126137
138+
### -ProtectPrivateKey
139+
140+
Specifies whether to protect the imported private key by virtualized-based security.
141+
If this parameter is specified with the value `vsm`, then the private key cannot be exported.
142+
Virtual Secure Mode (VSM) capabilities were introduced in Windows 10 and Windows Server 2016.
143+
144+
```yaml
145+
Type: Microsoft.CertificateServices.Commands.ProtectPrivateKeyType
146+
Parameter Sets: (All)
147+
Aliases:
148+
Accepted values: none, vsm
149+
150+
Required: False
151+
Position: Named
152+
Default value: None
153+
Accept pipeline input: False
154+
Accept wildcard characters: False
155+
```
156+
127157
### -FilePath
128158

129159
Specifies the path for the PFX file.
@@ -206,3 +236,5 @@ keys.
206236
[Export-PfxCertificate](./Export-PfxCertificate.md)
207237

208238
[System Store Locations](/windows/desktop/seccrypto/system-store-locations)
239+
240+
[Virtualization-based Security](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs)

docset/winserver2025-ps/pki/Import-PfxCertificate.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ destination store.
1717
## SYNTAX
1818

1919
```
20-
Import-PfxCertificate [-Exportable] [-Password <SecureString>]
21-
[[-CertStoreLocation] <String>] [-FilePath] <String> [-WhatIf] [-Confirm]
22-
[<CommonParameters>]
20+
Import-PfxCertificate [-Exportable] [-ProtectPrivateKey <ProtectPrivateKeyType>] [-Password <SecureString>]
21+
[[-CertStoreLocation] <String>] [-FilePath] <String>
22+
[-WhatIf] [-Confirm] [<CommonParameters>]
2323
```
2424

2525
## DESCRIPTION
@@ -72,6 +72,17 @@ This example imports the PFX file `mypfx.pfx` into the My store for the machine
7272
**Password** parameter is not required since this PFX file is protected using the domain account of
7373
this machine. This requires a Windows Server 2012 or later domain controller.
7474

75+
### EXAMPLE 4
76+
77+
```powershell
78+
Get-ChildItem -Path C:\mypfx.pfx |
79+
Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My -ProtectPrivateKey vsm
80+
```
81+
82+
This example imports the PFX file `mypfx.pfx` with a private key into the My store for the current user.
83+
The **Password** parameter is not required since this PFX file is not password protected.
84+
The private key will be protected by virtualized-based security (VBS) and cannot be exported.
85+
7586
## PARAMETERS
7687

7788
### -CertStoreLocation
@@ -124,6 +135,25 @@ Accept pipeline input: False
124135
Accept wildcard characters: False
125136
```
126137
138+
### -ProtectPrivateKey
139+
140+
Specifies whether to protect the imported private key by virtualized-based security.
141+
If this parameter is specified with the value `vsm`, then the private key cannot be exported.
142+
Virtual Secure Mode (VSM) capabilities were introduced in Windows 10 and Windows Server 2016.
143+
144+
```yaml
145+
Type: Microsoft.CertificateServices.Commands.ProtectPrivateKeyType
146+
Parameter Sets: (All)
147+
Aliases:
148+
Accepted values: none, vsm
149+
150+
Required: False
151+
Position: Named
152+
Default value: None
153+
Accept pipeline input: False
154+
Accept wildcard characters: False
155+
```
156+
127157
### -FilePath
128158

129159
Specifies the path for the PFX file.
@@ -206,3 +236,5 @@ keys.
206236
[Export-PfxCertificate](./Export-PfxCertificate.md)
207237

208238
[System Store Locations](/windows/desktop/seccrypto/system-store-locations)
239+
240+
[Virtualization-based Security](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs)

0 commit comments

Comments
 (0)