-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fix Az.KeyVault Syntax Errors #17601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Update-AzKeyVaultSecret -VaultName 'ContosoVault' -Name 'HR' -Version '9EEA45C6EE50490B9C3176A80AC1A0DF' -ContentType '' -Tag -@{} | ||
| $Tags = @{ 'Severity' = 'medium'; 'HR' = 'true'} | ||
| $ContentType= 'xml' | ||
| Update-AzKeyVaultSecret -VaultName 'ContosoVault' -Name 'HR' -Version '9EEA45C6EE50490B9C3176A80AC1A0DF' -ContentType $ContentType -Tag $Tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Tag @{} (delete the dash before @)
No other errors here. The purpose of this command is to delete, so blank value is assigned.
| ### Example 1 | ||
| ```powershell | ||
| Export-AzKeyVaultSecurityDomain -Name testmhsm -Certificates {pathOfCertificates}/sd1.cer, {pathOfCertificates}/sd2.cer, {pathOfCertificates}/sd3.cer -OutputPath {pathOfOutput}/sd.ps.json -Quorum 2 | ||
| Export-AzKeyVaultSecurityDomain -Name testmhsm -Certificates {{pathOfCertificates}/sd1.cer, {pathOfCertificates}/sd2.cer, {pathOfCertificates}/sd3.cer} -OutputPath {{pathOfOutput}/sd.ps.json} -Quorum 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original example, {} is not powershell gramma. It means that pathOfCertificates is a placeholder that user needs to replace with the real path.
If {} made our tooling think the example is wrong, I suggest replace {pathOfCertificates}/sd1.cer to ./sd1, and {pathOfOutput}/sd.ps.json to sd.ps.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. We will do that.
| ```powershell | ||
| $keys = @{PublicKey = "sd1.cer"; PrivateKey = "sd1.key"}, @{PublicKey = "sd2.cer"; PrivateKey = "sd2.key"}, @{PublicKey = "sd3.cer"; PrivateKey = "sd3.key"} | ||
| Import-AzKeyVaultSecurityDomain -Name testmhsm -Keys $keys -SecurityDomainPath {pathOfBackup}\sd.ps.json | ||
| Import-AzKeyVaultSecurityDomain -Name testmhsm -Keys $keys -SecurityDomainPath {{pathOfBackup}\sd.ps.json} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
| $Tags = @{ 'Severity' = 'medium'; 'HR' = 'true'} | ||
| $ContentType= 'xml' | ||
| Update-AzKeyVaultSecret -VaultName 'ContosoVault' -Name 'HR' -Version '9EEA45C6EE50490B9C3176A80AC1A0DF' -ContentType $ContentType -Tag $Tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $Tags = @{ 'Severity' = 'medium'; 'HR' = 'true'} | |
| $ContentType= 'xml' | |
| Update-AzKeyVaultSecret -VaultName 'ContosoVault' -Name 'HR' -Version '9EEA45C6EE50490B9C3176A80AC1A0DF' -ContentType $ContentType -Tag $Tags | |
| $ContentType= 'xml' | |
| Update-AzKeyVaultSecret -VaultName 'ContosoVault' -Name 'HR' -Version '9EEA45C6EE50490B9C3176A80AC1A0DF' -ContentType $ContentType -Tag @{} |
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added