Skip to content

Commit f220a97

Browse files
authored
[KeyVault] Fix minor bugs (#13779)
* fix 13583 13584 * suppress breaking change
1 parent 9dae391 commit f220a97

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$vaultName = 'yemingkv27'
2+
3+
4+
. "$PSScriptRoot\..\Scripts\Common.ps1"
5+
6+
Describe "Update key" {
7+
It "should update multiple versions" {
8+
$keyName = Get-KeyName
9+
Add-AzKeyVaultKey -VaultName $vaultName -Name $keyName -Destination Software
10+
Add-AzKeyVaultKey -VaultName $vaultName -Name $keyName -Destination Software
11+
Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | Should -HaveCount 2
12+
13+
Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | Update-AzKeyVaultKey -Enable $false
14+
Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | ForEach-Object { $_.Enabled | Should -BeFalse }
15+
16+
Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | Update-AzKeyVaultKey -Enable $true
17+
Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | ForEach-Object { $_.Enabled | Should -BeTrue }
18+
}
19+
}

src/KeyVault/KeyVault/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Upcoming Release
2121
* Added a new parameter `-AsPlainText` to `Get-AzKeyVaultSecret` to directly return the secret in plain text [#13630]
2222
* Supported selective restore a key from a managed HSM full backup [#13526]
23+
* Fixed some minor issues [#13583] [#13584]
2324
* Added missing return objects of `Get-Secret` in SecretManagement module
2425
* Fixed an issue that may cause vault to be created without default access policy [#13687]
2526

src/KeyVault/KeyVault/Commands/GetAzureKeyVaultKey.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,13 @@ public class GetAzureKeyVaultKey : KeyVaultCmdletBase
128128
/// KeyVault resource id
129129
/// </summary>
130130
[Parameter(Mandatory = true,
131-
Position = 0,
132131
ValueFromPipelineByPropertyName = true,
133132
ParameterSetName = ResourceIdByVaultNameParameterSet,
134133
HelpMessage = "KeyVault Resource Id.")]
135134
[Parameter(Mandatory = true,
136-
Position = 0,
137135
ValueFromPipelineByPropertyName = true,
138136
ParameterSetName = ResourceIdByKeyNameParameterSet)]
139137
[Parameter(Mandatory = true,
140-
Position = 0,
141138
ValueFromPipelineByPropertyName = true,
142139
ParameterSetName = ResourceIdByKeyVersionsParameterSet)]
143140
[ValidateNotNullOrEmpty]

src/KeyVault/KeyVault/Commands/UpdateAzureKeyVaultKey.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ private void NormalizeParameterSets()
175175
VaultName = InputObject.VaultName;
176176
}
177177
Name = InputObject.Name;
178+
Version = InputObject.Version;
178179
}
179180
}
180181
}

tools/StaticAnalysis/Exceptions/Az.KeyVault/BreakingChangeIssues.csv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.Commands.NewAzureManagedHsmRoleAssignment","New-AzManagedHsmRoleAssignment","0","1000","The cmdlet 'New-AzManagedHsmRoleAssignment' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'New-AzManagedHsmRoleAssignment' back to the module, or add an alias to the original cmdlet name."
1818
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.Commands.RemoveAzureManagedHsmRoleAssignment","Remove-AzManagedHsmRoleAssignment","0","1000","The cmdlet 'Remove-AzManagedHsmRoleAssignment' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'Remove-AzManagedHsmRoleAssignment' back to the module, or add an alias to the original cmdlet name."
1919
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.Commands.UndoAzureManagedHsmKeyRemoval","Undo-AzManagedHsmKeyRemoval","0","1000","The cmdlet 'Undo-AzManagedHsmKeyRemoval' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'Undo-AzManagedHsmKeyRemoval' back to the module, or add an alias to the original cmdlet name."
20-
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.Commands.UpdateAzureManagedHsm","Update-AzManagedHsm","0","1000","The cmdlet 'Update-AzManagedHsm' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'Update-AzManagedHsm' back to the module, or add an alias to the original cmdlet name."
20+
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.Commands.UpdateAzureManagedHsm","Update-AzManagedHsm","0","1000","The cmdlet 'Update-AzManagedHsm' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'Update-AzManagedHsm' back to the module, or add an alias to the original cmdlet name."
21+
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.GetAzureKeyVaultKey","Get-AzKeyVaultKey","0","1050","The parameter set 'ByResourceIdVaultName' for cmdlet 'Get-AzKeyVaultKey' has been removed.","Add parameter set 'ByResourceIdVaultName' back to cmdlet 'Get-AzKeyVaultKey'."
22+
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.GetAzureKeyVaultKey","Get-AzKeyVaultKey","0","1050","The parameter set 'ByResourceIdKeyName' for cmdlet 'Get-AzKeyVaultKey' has been removed.","Add parameter set 'ByResourceIdKeyName' back to cmdlet 'Get-AzKeyVaultKey'."
23+
"Microsoft.Azure.PowerShell.Cmdlets.KeyVault.dll","Microsoft.Azure.Commands.KeyVault.GetAzureKeyVaultKey","Get-AzKeyVaultKey","0","1050","The parameter set 'ByResourceIdKeyVersions' for cmdlet 'Get-AzKeyVaultKey' has been removed.","Add parameter set 'ByResourceIdKeyVersions' back to cmdlet 'Get-AzKeyVaultKey'."

0 commit comments

Comments
 (0)