Skip to content

Commit 4d22bf5

Browse files
NoriZCBethanyZhou
andauthored
[Az.KeyVault] Add help example title for Import-AzKeyVaultSecurityDomain (#22831)
* Add help example title * Update src/KeyVault/KeyVault/help/Import-AzKeyVaultSecurityDomain.md --------- Co-authored-by: Beisi Zhou <[email protected]>
1 parent 20c34c0 commit 4d22bf5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/KeyVault/KeyVault/SecurityDomain/Cmdlets/ImportAzKeyVaultSecurityDomain.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.Azure.Commands.Common.Authentication;
2+
using Microsoft.Azure.Commands.Common.Exceptions;
23
using Microsoft.Azure.Commands.KeyVault.Models;
34
using Microsoft.Azure.Commands.KeyVault.Properties;
45
using Microsoft.Azure.Commands.KeyVault.SecurityDomain.Common;
@@ -159,11 +160,11 @@ private void ValidateParameters()
159160
{
160161
if (Keys.Length < 2)
161162
{
162-
throw new ArgumentException(string.Format(Resources.RestoreSecurityDomainNotEnoughKey, Common.Constants.MinQuorum));
163+
throw new AzPSArgumentException(string.Format(Resources.RestoreSecurityDomainNotEnoughKey, Common.Constants.MinQuorum), nameof(Keys));
163164
}
164165
if (Keys.Any(key => string.IsNullOrEmpty(key.PublicKey) || string.IsNullOrEmpty(key.PrivateKey)))
165166
{
166-
throw new ArgumentException(Resources.RestoreSecurityDomainBadKey);
167+
throw new AzPSArgumentException(Resources.RestoreSecurityDomainBadKey, nameof(Keys));
167168
}
168169
}
169170

src/KeyVault/KeyVault/help/Import-AzKeyVaultSecurityDomain.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This cmdlet imports previously exported security domain data to a managed HSM.
5252

5353
## EXAMPLES
5454

55-
### Example 1
55+
### Example 1: Import Security domain
5656
```powershell
5757
$keys = @{PublicKey = "sd1.cer"; PrivateKey = "sd1.key"}, @{PublicKey = "sd2.cer"; PrivateKey = "sd2.key"}, @{PublicKey = "sd3.cer"; PrivateKey = "sd3.key"}
5858
Import-AzKeyVaultSecurityDomain -Name testmhsm -Keys $keys -SecurityDomainPath sd.ps.json
@@ -61,7 +61,7 @@ Import-AzKeyVaultSecurityDomain -Name testmhsm -Keys $keys -SecurityDomainPath s
6161
First, the keys need be provided to decrypt the security domain data.
6262
Then, The **Import-AzKeyVaultSecurityDomain** command restores previous backed up security domain data to a managed HSM using these keys.
6363

64-
### Example 2
64+
### Example 2: Import Security domain by separate steps
6565
```powershell
6666
$exchangeKeyOutputPath = "ExchangeKey.cer"
6767
$SecurityDomainRestoredBlob = "HsmRestoreBlob.json"

0 commit comments

Comments
 (0)