Skip to content

Commit bd1f44b

Browse files
author
Maddie Clayton
authored
Update KeyVault documentation (#6308)
* add docs * more changes * fix keyvault docs * fixes * update changelog * fix build * Update Restore-AzureKeyVaultManagedStorageAccount.md * address comments * add exception * address comments * fix issues * Update Backup-AzureKeyVaultCertificate.md * Update Backup-AzureKeyVaultKey.md * Update Backup-AzureKeyVaultManagedStorageAccount.md
1 parent e86eed6 commit bd1f44b

File tree

72 files changed

+1722
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1722
-418
lines changed

src/ResourceManager/KeyVault/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Update documentation with example output
2122

2223
## Version 5.0.0
2324
* Breaking changes to support piping scenarios

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/GetAzureKeyVaultManagedStorageAccount.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using System.Collections.Generic;
1818
using System.Management.Automation;
1919
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
20-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2120
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
2221

2322
namespace Microsoft.Azure.Commands.KeyVault

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/GetAzureKeyVaultManagedStorageSasDefinition.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using System.Collections.Generic;
1818
using System.Management.Automation;
1919
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
20-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2120

2221
namespace Microsoft.Azure.Commands.KeyVault
2322
{

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/RemoveAzureKeyVaultManagedStorageAccount.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using System.Globalization;
1717
using System.Management.Automation;
1818
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
19-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2019
using Microsoft.Azure.Commands.KeyVault.Properties;
2120

2221
namespace Microsoft.Azure.Commands.KeyVault

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/RemoveAzureKeyVaultManagedStorageSasDefinition.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using System.Globalization;
1717
using System.Management.Automation;
1818
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
19-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2019

2120
namespace Microsoft.Azure.Commands.KeyVault
2221
{

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/UndoAzureKeyVaultManagedStorageAccountRemoval.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.Azure.Commands.KeyVault.Models;
17-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
18-
using Microsoft.Azure.KeyVault.Models;
1917

2018
namespace Microsoft.Azure.Commands.KeyVault
2119
{

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/UndoAzureKeyVaultManagedStorageSasDefinitionRemoval.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.Azure.Commands.KeyVault.Models;
17-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
1817

1918
namespace Microsoft.Azure.Commands.KeyVault
2019
{

src/ResourceManager/KeyVault/Commands.KeyVault/Models/IKeyVaultDataServiceClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using System.Collections.Generic;
1818
using System.Security;
1919
using System.Security.Cryptography.X509Certificates;
20-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2120
using Microsoft.Azure.KeyVault.Models;
2221
using Microsoft.Azure.KeyVault.WebKey;
2322

src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System.Security.Cryptography.X509Certificates;
2323
using System.Xml;
2424
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
25-
using Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts;
2625
using Microsoft.Azure.KeyVault;
2726
using Microsoft.Azure.KeyVault.Models;
2827
using Microsoft.Azure.KeyVault.WebKey;

src/ResourceManager/KeyVault/Commands.KeyVault/Models/ManagedStorageAccounts/PSDeletedKeyVaultManagedStorageAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
1818

1919

20-
namespace Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts
20+
namespace Microsoft.Azure.Commands.KeyVault.Models
2121
{
2222
public sealed class PSDeletedKeyVaultManagedStorageAccount : PSDeletedKeyVaultManagedStorageAccountIdentityItem
2323
{

src/ResourceManager/KeyVault/Commands.KeyVault/Models/ManagedStorageAccounts/PSDeletedKeyVaultManagedStorageAccountIdentityItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using System;
1616

17-
namespace Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts
17+
namespace Microsoft.Azure.Commands.KeyVault.Models
1818
{
1919
public class PSDeletedKeyVaultManagedStorageAccountIdentityItem : PSKeyVaultManagedStorageAccountIdentityItem
2020
{

src/ResourceManager/KeyVault/Commands.KeyVault/Models/ManagedStorageAccounts/PSDeletedKeyVaultManagedStorageSasDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using System;
1616
using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;
1717

18-
namespace Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts
18+
namespace Microsoft.Azure.Commands.KeyVault.Models
1919
{
2020
public sealed class PSDeletedKeyVaultManagedStorageSasDefinition : PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem
2121
{

src/ResourceManager/KeyVault/Commands.KeyVault/Models/ManagedStorageAccounts/PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using System;
1616

17-
namespace Microsoft.Azure.Commands.KeyVault.Models.ManagedStorageAccounts
17+
namespace Microsoft.Azure.Commands.KeyVault.Models
1818
{
1919
public class PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem : PSKeyVaultManagedStorageSasDefinitionIdentityItem
2020
{

src/ResourceManager/KeyVault/Commands.KeyVault/Models/PSDeletedKeyVaultCertificate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal PSDeletedKeyVaultCertificate(DeletedCertificateBundle deletedCertificat
6767

6868
if (deletedCertificateBundle.Tags != null)
6969
{
70-
Tags = (Hashtable) deletedCertificateBundle.Tags;
70+
Tags = deletedCertificateBundle.Tags.ConvertToHashtable();
7171
}
7272

7373
ScheduledPurgeDate = deletedCertificateBundle.ScheduledPurgeDate;
@@ -123,7 +123,7 @@ internal PSDeletedKeyVaultCertificate(DeletedCertificateBundle deletedCertificat
123123

124124
if (deletedCertificateBundle.Tags != null)
125125
{
126-
Tags = (Hashtable) deletedCertificateBundle.Tags;
126+
Tags = deletedCertificateBundle.Tags.ConvertToHashtable();
127127
}
128128

129129
ScheduledPurgeDate = deletedCertificateBundle.ScheduledPurgeDate;

src/ResourceManager/KeyVault/Commands.KeyVault/help/Add-AzureKeyVaultCertificate.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ The **Add-AzureKeyVaultCertificate** cmdlet starts the process of enrolling for
2525
## EXAMPLES
2626

2727
### Example 1: Add a certificate
28-
```
29-
PS C:\>$Policy = New-AzureKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal
28+
```powershell
29+
PS C:\> $Policy = New-AzureKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal
3030
PS C:\> Add-AzureKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01" -CertificatePolicy $Policy
3131
3232
Status : inProgress
@@ -38,7 +38,9 @@ CertificateSigningRequest : MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLY29udG9zby5jb20wggEi
3838
YnC9Py7Wp7CHfKzuqeptUk2Tsu7B5dHB+o9Ypeeqw8fWhTN0GFGRKO7WjZQlDqL+lRNcjlFSaP022oIP0kmvVhBcmZqRQlALXccAaxEclFA/3y/aNj2gwWeKpH/pwAkZ39zMEzpQCaRfnQk7e3l4MV8cf
3939
eC2HPYdRWkXxAeDcNPxBuVmKy49AzYvly+APNVDU3v66gxl3fIKrGRsKi2Cp/nO5rBxG2h8t+0Za4l/HJ7ZWR9wKbd/xg7JhdZZFVBxMHYzw8KQ0ys13x8HY+PXU92Y7yD3uC2Rcj+zbAf+Kg==
4040
ErrorCode :
41-
ErrorMessage : PS C:\>Get-AzureKeyVaultCertificateOperation -VaultName "ContosoKV01" -Name "TestCert01"
41+
ErrorMessage :
42+
43+
PS C:\> Get-AzureKeyVaultCertificateOperation -VaultName "ContosoKV01" -Name "TestCert01"
4244
Status : completed
4345
CancellationRequested : False
4446
CertificateSigningRequest : MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLY29udG9zby5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC73w3VRBOlgJ5Od1PjDh+2ytngNZp+ZP4fkuX8K1Ti5LA6Ih7eWx1fgAN/iTb6l
@@ -48,7 +50,10 @@ CertificateSigningRequest : MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLY29udG9zby5jb20wggEi
4850
YnC9Py7Wp7CHfKzuqeptUk2Tsu7B5dHB+o9Ypeeqw8fWhTN0GFGRKO7WjZQlDqL+lRNcjlFSaP022oIP0kmvVhBcmZqRQlALXccAaxEclFA/3y/aNj2gwWeKpH/pwAkZ39zMEzpQCaRfnQk7e3l4MV8cf
4951
eC2HPYdRWkXxAeDcNPxBuVmKy49AzYvly+APNVDU3v66gxl3fIKrGRsKi2Cp/nO5rBxG2h8t+0Za4l/HJ7ZWR9wKbd/xg7JhdZZFVBxMHYzw8KQ0ys13x8HY+PXU92Y7yD3uC2Rcj+zbAf+Kg==
5052
ErrorCode :
51-
ErrorMessage : PS C:\>Get-AzureKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01"
53+
ErrorMessage :
54+
55+
PS C:\> Get-AzureKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01"
56+
5257
Name : testCert01
5358
Certificate : [Subject]
5459
CN=contoso.com
@@ -57,7 +62,7 @@ Certificate : [Subject]
5762
CN=contoso.com
5863
5964
[Serial Number]
60-
05979C5A2F0741D5A3B6F97673E8A118
65+
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
6166
6267
[Not Before]
6368
2/8/2016 3:11:45 PM
@@ -66,9 +71,9 @@ Certificate : [Subject]
6671
8/8/2016 4:21:45 PM
6772
6873
[Thumbprint]
69-
3E9B6848AD1834284157D68B060F748037F663C8
74+
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7075
71-
Thumbprint : 3E9B6848AD1834284157D68B060F748037F663C8
76+
Thumbprint : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7277
Tags :
7378
Enabled : True
7479
Created : 2/8/2016 11:21:45 PM
@@ -198,8 +203,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
198203
199204
## INPUTS
200205
201-
### None
202-
This cmdlet does not accept any input.
206+
### Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultCertificatePolicy
203207
204208
## OUTPUTS
205209

src/ResourceManager/KeyVault/Commands.KeyVault/help/Add-AzureKeyVaultCertificateContact.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ These events are determined by the certificate policy.
3939
## EXAMPLES
4040

4141
### Example 1: Add a key vault certificate contact
42-
```
43-
PS C:\>Add-AzureKeyVaultCertificateContact -VaultName "ContosoKV01" -EmailAddress "[email protected]" -PassThru
42+
```powershell
43+
PS C:\> Add-AzureKeyVaultCertificateContact -VaultName "ContosoKV01" -EmailAddress "[email protected]" -PassThru
44+
45+
Email VaultName
46+
----- ---------
47+
[email protected] ContosoKV01
4448
```
4549

46-
This command adds Patti Fuller as a certificate contact for the ContosoKV01 key vault and returns the **KeyVaultCertificateContact** object.
50+
This command adds Patti Fuller as a certificate contact for the ContosoKV01 key vault and returns the list of contacts for the "ContosoKV01" vault.
4751

4852
## PARAMETERS
4953

@@ -174,12 +178,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
174178
175179
## INPUTS
176180
177-
### None
178-
This cmdlet does not accept any input.
181+
### Microsoft.Azure.Commands.KeyVault.Models.PSKeyVault
179182
180183
## OUTPUTS
181184
182-
### List<Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultCertificateContact>
185+
### Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultCertificateContact
183186
184187
## NOTES
185188

src/ResourceManager/KeyVault/Commands.KeyVault/help/Add-AzureKeyVaultKey.md

Lines changed: 94 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,64 @@ backup of it that you can restore.
8989
## EXAMPLES
9090

9191
### Example 1: Create a key
92-
```
93-
PS C:\>Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITSoftware' -Destination 'Software'
92+
```powershell
93+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITSoftware' -Destination 'Software'
94+
95+
Vault Name : contoso
96+
Name : ITSoftware
97+
Version : 67da57e9cadf48a2ad8d366b115843ab
98+
Id : https://contoso.vault.azure.net:443/keys/ITSoftware/67da57e9cadf48a2ad8d366b115843ab
99+
Enabled : True
100+
Expires :
101+
Not Before :
102+
Created : 5/21/2018 11:10:58 PM
103+
Updated : 5/21/2018 11:10:58 PM
104+
Purge Disabled : False
105+
Tags :
94106
```
95107

96108
This command creates a software-protected key named ITSoftware in the key vault named Contoso.
97109

98110
### Example 2: Create an HSM-protected key
99-
```
100-
PS C:\>Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITHsm' -Destination 'HSM'
111+
```powershell
112+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITHsm' -Destination 'HSM'
113+
114+
Vault Name : contoso
115+
Name : ITHsm
116+
Version : 67da57e9cadf48a2ad8d366b115843ab
117+
Id : https://contoso.vault.azure.net:443/keys/ITSoftware/67da57e9cadf48a2ad8d366b115843ab
118+
Enabled : True
119+
Expires :
120+
Not Before :
121+
Created : 5/21/2018 11:10:58 PM
122+
Updated : 5/21/2018 11:10:58 PM
123+
Purge Disabled : False
124+
Tags :
101125
```
102126

103127
This command creates an HSM-protected key in the key vault named Contoso.
104128

105129
### Example 3: Create a key with non-default values
106-
```
107-
PS C:\>$KeyOperations = 'decrypt', 'verify'
130+
```powershell
131+
PS C:\> $KeyOperations = 'decrypt', 'verify'
108132
PS C:\> $Expires = (Get-Date).AddYears(2).ToUniversalTime()
109133
PS C:\> $NotBefore = (Get-Date).ToUniversalTime()
110-
PS C:\> $Tags = @{'Severity' = 'high'; 'Accounting' = null}
111-
PS C:\> Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITHsmNonDefault' -Destination 'HSM' -Expires $Expires -NotBefore $NotBefore -KeyOps $KeyOperations -Disable -Tag $Tags
134+
PS C:\> $Tags = @{'Severity' = 'high'; 'Accounting' = "true"}
135+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITHsmNonDefault' -Destination 'HSM' -Expires $Expires -NotBefore $NotBefore -KeyOps $KeyOperations -Disable -Tag $Tags
136+
137+
Vault Name : contoso
138+
Name : ITHsmNonDefault
139+
Version : 929bfc14db84439b823ffd1bedadaf5f
140+
Id : https://contoso.vault.azure.net:443/keys/ITHsmNonDefault/929bfc14db84439b823ffd1bedadaf5f
141+
Enabled : False
142+
Expires : 5/21/2020 11:12:43 PM
143+
Not Before : 5/21/2018 11:12:50 PM
144+
Created : 5/21/2018 11:13:17 PM
145+
Updated : 5/21/2018 11:13:17 PM
146+
Purge Disabled : False
147+
Tags : Name Value
148+
Severity high
149+
Accounting true
112150
```
113151

114152
The first command stores the values decrypt and verify in the $KeyOperations variable.
@@ -127,8 +165,20 @@ severity and IT. The new key is disabled. You can enable it by using the **Set-A
127165
cmdlet.
128166

129167
### Example 4: Import an HSM-protected key
130-
```
131-
PS C:\>Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITByok' -KeyFilePath 'C:\Contoso\ITByok.byok' -Destination 'HSM'
168+
```powershell
169+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITByok' -KeyFilePath 'C:\Contoso\ITByok.byok' -Destination 'HSM'
170+
171+
Vault Name : contoso
172+
Name : ITByok
173+
Version : 67da57e9cadf48a2ad8d366b115843ab
174+
Id : https://contoso.vault.azure.net:443/keys/ITByok/67da57e9cadf48a2ad8d366b115843ab
175+
Enabled : True
176+
Expires :
177+
Not Before :
178+
Created : 5/21/2018 11:10:58 PM
179+
Updated : 5/21/2018 11:10:58 PM
180+
Purge Disabled : False
181+
Tags :
132182
```
133183

134184
This command imports the key named ITByok from the location that the *KeyFilePath* parameter
@@ -139,9 +189,21 @@ For more information, see
139189
[How to Generate and Transfer HSM-Protected Keys for Azure Key Vault](http://go.microsoft.com/fwlink/?LinkId=522252).
140190

141191
### Example 5: Import a software-protected key
142-
```
143-
PS C:\>$Password = ConvertTo-SecureString -String 'Password' -AsPlainText -Force
144-
PS C:\> Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITPfx' -KeyFilePath 'C:\Contoso\ITPfx.pfx' -KeyFilePassword $Password
192+
```powershell
193+
PS C:\> $Password = ConvertTo-SecureString -String 'Password' -AsPlainText -Force
194+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITPfx' -KeyFilePath 'C:\Contoso\ITPfx.pfx' -KeyFilePassword $Password
195+
196+
Vault Name : contoso
197+
Name : ITPfx
198+
Version : 67da57e9cadf48a2ad8d366b115843ab
199+
Id : https://contoso.vault.azure.net:443/keys/ITPfx/67da57e9cadf48a2ad8d366b115843ab
200+
Enabled : True
201+
Expires :
202+
Not Before :
203+
Created : 5/21/2018 11:10:58 PM
204+
Updated : 5/21/2018 11:10:58 PM
205+
Purge Disabled : False
206+
Tags :
145207
```
146208

147209
The first command converts a string into a secure string by using the **ConvertTo-SecureString**
@@ -152,11 +214,25 @@ The second command creates a software password in the Contoso key vault. The com
152214
location for the key and the password stored in $Password.
153215

154216
### Example 6: Import a key and assign attributes
155-
```
156-
PS C:\>$Password = ConvertTo-SecureString -String 'password' -AsPlainText -Force
217+
```powershell
218+
PS C:\> $Password = ConvertTo-SecureString -String 'password' -AsPlainText -Force
157219
PS C:\> $Expires = (Get-Date).AddYears(2).ToUniversalTime()
158-
PS C:\> $Tags = @{ 'Severity' = 'high'; 'Accounting' = null }
159-
PS C:\> Add-AzureKeyVaultKey -VaultName 'Contoso' -Name 'ITPfxToHSM' -Destination 'HSM' -KeyFilePath 'C:\Contoso\ITPfx.pfx' -KeyFilePassword $Password -Expires $Expires -Tag $Tags
220+
PS C:\> $Tags = @{ 'Severity' = 'high'; 'Accounting' = "true" }
221+
PS C:\> Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITPfxToHSM' -Destination 'HSM' -KeyFilePath 'C:\Contoso\ITPfx.pfx' -KeyFilePassword $Password -Expires $Expires -Tag $Tags
222+
223+
Vault Name : contoso
224+
Name : ITPfxToHSM
225+
Version : 929bfc14db84439b823ffd1bedadaf5f
226+
Id : https://contoso.vault.azure.net:443/keys/ITPfxToHSM/929bfc14db84439b823ffd1bedadaf5f
227+
Enabled : True
228+
Expires : 5/21/2020 11:12:43 PM
229+
Not Before :
230+
Created : 5/21/2018 11:13:17 PM
231+
Updated : 5/21/2018 11:13:17 PM
232+
Purge Disabled : False
233+
Tags : Name Value
234+
Severity high
235+
Accounting true
160236
```
161237

162238
The first command converts a string into a secure string by using the **ConvertTo-SecureString**
@@ -483,8 +559,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
483559

484560
## INPUTS
485561

486-
### None
487-
This cmdlet does not accept any input.
562+
### Microsoft.Azure.Commands.KeyVault.Models.PSKeyVault
488563

489564
## OUTPUTS
490565

0 commit comments

Comments
 (0)