Skip to content

Commit f069037

Browse files
committed
Removed confirm impact to use default for Undo* and added an alias and fixed test
1 parent be40276 commit f069037

File tree

8 files changed

+35
-30
lines changed

8 files changed

+35
-30
lines changed

src/ResourceManager/KeyVault/Commands.KeyVault.Test/ScenarioTests/KeyVaultManagementTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void TestGetVaultByNameCapitalized()
182182
);
183183
}
184184

185-
[Fact(Skip = "The current SynchronizationContext may not be used as a TaskScheduler.")]
185+
[Fact]
186186
[Trait(Category.AcceptanceType, Category.CheckIn)]
187187
public void TestGetUnknownVaultFails()
188188
{
@@ -196,7 +196,7 @@ public void TestGetUnknownVaultFails()
196196

197197
}
198198

199-
[Fact(Skip = "The current SynchronizationContext may not be used as a TaskScheduler.")]
199+
[Fact]
200200
[Trait(Category.AcceptanceType, Category.CheckIn)]
201201
public void TestGetVaultFromUnknownResourceGroupFails()
202202
{

src/ResourceManager/KeyVault/Commands.KeyVault.Test/SessionRecords/Microsoft.Azure.Commands.KeyVault.Test.ScenarioTests.KeyVaultManagementTests/TestGetUnknownVaultFails.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
22
"Entries": [
33
{
4-
"RequestUri": "/subscriptions/4fbe2810-8ec4-4443-88f4-1d0a6a212d02/resourceGroups/pshtestrg4931/providers/Microsoft.KeyVault/vaults/onesdk5008?api-version=2015-06-01",
5-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGZiZTI4MTAtOGVjNC00NDQzLTg4ZjQtMWQwYTZhMjEyZDAyL3Jlc291cmNlR3JvdXBzL3BzaHRlc3RyZzQ5MzEvcHJvdmlkZXJzL01pY3Jvc29mdC5LZXlWYXVsdC92YXVsdHMvb25lc2RrNTAwOD9hcGktdmVyc2lvbj0yMDE1LTA2LTAx",
4+
"RequestUri": "/subscriptions/4fbe2810-8ec4-4443-88f4-1d0a6a212d02/resourceGroups/pshtestrg6477/providers/Microsoft.KeyVault/vaults/onesdk5122?api-version=2016-10-01",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGZiZTI4MTAtOGVjNC00NDQzLTg4ZjQtMWQwYTZhMjEyZDAyL3Jlc291cmNlR3JvdXBzL3BzaHRlc3RyZzY0NzcvcHJvdmlkZXJzL01pY3Jvc29mdC5LZXlWYXVsdC92YXVsdHMvb25lc2RrNTEyMj9hcGktdmVyc2lvbj0yMDE2LTEwLTAx",
66
"RequestMethod": "GET",
77
"RequestBody": "",
88
"RequestHeaders": {
99
"x-ms-client-request-id": [
10-
"decac27c-6ea5-462e-a64c-5979bdb2d9df"
10+
"6cf4b48d-2199-411e-9374-6da673ba17a6"
1111
],
1212
"accept-language": [
1313
"en-US"
1414
],
1515
"User-Agent": [
16-
"Microsoft.Azure.Management.KeyVault.KeyVaultManagementClient/2.0.0-preview"
16+
"FxVersion/4.6.1637.0",
17+
"OSName/Windows_10_Enterprise",
18+
"OSVersion/6.3.14393",
19+
"Microsoft.Azure.Management.KeyVault.KeyVaultManagementClient/2.2.0-preview"
1720
]
1821
},
19-
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.KeyVault/vaults/onesdk5008' under resource group 'pshtestrg4931' was not found.\"\r\n }\r\n}",
22+
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.KeyVault/vaults/onesdk5122' under resource group 'pshtestrg6477' was not found.\"\r\n }\r\n}",
2023
"ResponseHeaders": {
2124
"Content-Length": [
2225
"153"
@@ -34,13 +37,13 @@
3437
"gateway"
3538
],
3639
"x-ms-request-id": [
37-
"a2383a58-d9d4-47b2-a797-70c17d174a9c"
40+
"d5dd7dc9-cdbe-4399-8160-0fe653a251cc"
3841
],
3942
"x-ms-correlation-request-id": [
40-
"a2383a58-d9d4-47b2-a797-70c17d174a9c"
43+
"d5dd7dc9-cdbe-4399-8160-0fe653a251cc"
4144
],
4245
"x-ms-routing-request-id": [
43-
"WESTUS:20160714T204530Z:a2383a58-d9d4-47b2-a797-70c17d174a9c"
46+
"WESTUS2:20170429T002509Z:d5dd7dc9-cdbe-4399-8160-0fe653a251cc"
4447
],
4548
"Strict-Transport-Security": [
4649
"max-age=31536000; includeSubDomains"
@@ -49,21 +52,21 @@
4952
"no-cache"
5053
],
5154
"Date": [
52-
"Thu, 14 Jul 2016 20:45:30 GMT"
55+
"Sat, 29 Apr 2017 00:25:08 GMT"
5356
]
5457
},
5558
"StatusCode": 404
5659
}
5760
],
5861
"Names": {
5962
"Test-GetUnknownVaultFails": [
60-
"onesdk5008"
63+
"onesdk5122"
6164
]
6265
},
6366
"Variables": {
64-
"ResourceGroupName": "pshtestrg4931",
67+
"ResourceGroupName": "pshtestrg6477",
6568
"Location": "northcentralus",
66-
"PreCreatedVault": "pshtestvault7685",
69+
"PreCreatedVault": "pshtestvault7903",
6770
"SubscriptionId": "4fbe2810-8ec4-4443-88f4-1d0a6a212d02",
6871
"TenantId": "dab60df3-eb31-470e-9aa7-0bb580c2624c",
6972
"Domain": "mstestkeyvaultoutlook.onmicrosoft.com",

src/ResourceManager/KeyVault/Commands.KeyVault.Test/SessionRecords/Microsoft.Azure.Commands.KeyVault.Test.ScenarioTests.KeyVaultManagementTests/TestGetVaultFromUnknownResourceGroupFails.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
22
"Entries": [
33
{
4-
"RequestUri": "/subscriptions/4fbe2810-8ec4-4443-88f4-1d0a6a212d02/resourceGroups/onesdk9650/providers/Microsoft.KeyVault/vaults/pshtestvault7685?api-version=2015-06-01",
5-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGZiZTI4MTAtOGVjNC00NDQzLTg4ZjQtMWQwYTZhMjEyZDAyL3Jlc291cmNlR3JvdXBzL29uZXNkazk2NTAvcHJvdmlkZXJzL01pY3Jvc29mdC5LZXlWYXVsdC92YXVsdHMvcHNodGVzdHZhdWx0NzY4NT9hcGktdmVyc2lvbj0yMDE1LTA2LTAx",
4+
"RequestUri": "/subscriptions/4fbe2810-8ec4-4443-88f4-1d0a6a212d02/resourceGroups/onesdk2230/providers/Microsoft.KeyVault/vaults/pshtestvault31?api-version=2016-10-01",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNGZiZTI4MTAtOGVjNC00NDQzLTg4ZjQtMWQwYTZhMjEyZDAyL3Jlc291cmNlR3JvdXBzL29uZXNkazIyMzAvcHJvdmlkZXJzL01pY3Jvc29mdC5LZXlWYXVsdC92YXVsdHMvcHNodGVzdHZhdWx0MzE/YXBpLXZlcnNpb249MjAxNi0xMC0wMQ==",
66
"RequestMethod": "GET",
77
"RequestBody": "",
88
"RequestHeaders": {
99
"x-ms-client-request-id": [
10-
"29157c8d-f404-4d9f-b3eb-c90b15386ebd"
10+
"3b976bc1-c1bb-45cc-8832-88e753b32629"
1111
],
1212
"accept-language": [
1313
"en-US"
1414
],
1515
"User-Agent": [
16-
"Microsoft.Azure.Management.KeyVault.KeyVaultManagementClient/2.0.0-preview"
16+
"FxVersion/4.6.1637.0",
17+
"OSName/Windows_10_Enterprise",
18+
"OSVersion/6.3.14393",
19+
"Microsoft.Azure.Management.KeyVault.KeyVaultManagementClient/2.2.0-preview"
1720
]
1821
},
19-
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'onesdk9650' could not be found.\"\r\n }\r\n}",
22+
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'onesdk2230' could not be found.\"\r\n }\r\n}",
2023
"ResponseHeaders": {
2124
"Content-Length": [
2225
"102"
@@ -34,13 +37,13 @@
3437
"gateway"
3538
],
3639
"x-ms-request-id": [
37-
"e1eef3e3-a3f1-45bf-bddb-14e296620356"
40+
"68098da2-4d21-4e20-a1e4-4803978fd581"
3841
],
3942
"x-ms-correlation-request-id": [
40-
"e1eef3e3-a3f1-45bf-bddb-14e296620356"
43+
"68098da2-4d21-4e20-a1e4-4803978fd581"
4144
],
4245
"x-ms-routing-request-id": [
43-
"WESTUS:20160714T204517Z:e1eef3e3-a3f1-45bf-bddb-14e296620356"
46+
"WESTUS2:20170429T003017Z:68098da2-4d21-4e20-a1e4-4803978fd581"
4447
],
4548
"Strict-Transport-Security": [
4649
"max-age=31536000; includeSubDomains"
@@ -49,21 +52,21 @@
4952
"no-cache"
5053
],
5154
"Date": [
52-
"Thu, 14 Jul 2016 20:45:17 GMT"
55+
"Sat, 29 Apr 2017 00:30:16 GMT"
5356
]
5457
},
5558
"StatusCode": 404
5659
}
5760
],
5861
"Names": {
5962
"Test-GetVaultFromUnknownResourceGroupFails": [
60-
"onesdk9650"
63+
"onesdk2230"
6164
]
6265
},
6366
"Variables": {
64-
"ResourceGroupName": "pshtestrg4931",
67+
"ResourceGroupName": "pshtestrg7446",
6568
"Location": "northcentralus",
66-
"PreCreatedVault": "pshtestvault7685",
69+
"PreCreatedVault": "pshtestvault31",
6770
"SubscriptionId": "4fbe2810-8ec4-4443-88f4-1d0a6a212d02",
6871
"TenantId": "dab60df3-eb31-470e-9aa7-0bb580c2624c",
6972
"Domain": "mstestkeyvaultoutlook.onmicrosoft.com",

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/Constants.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ namespace Microsoft.Azure.Commands.KeyVault
33
{
44
public static class Constants
55
{
6-
public const string KeyVaultHelpUri = "https://msdn.microsoft.com/en-us/library/dn868052.aspx";
6+
public const string KeyVaultHelpUri = "https://msdn.microsoft.com/en-us/library/dn868052.aspx";
7+
public const string Name = "Name";
78
public const string KeyName = "KeyName";
89
public const string SecretName = "SecretName";
910
public const string CertificateName = "CertificateName";

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVault.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class GetAzureKeyVault : KeyVaultManagementCmdletBase
5252
Position = 0,
5353
ValueFromPipelineByPropertyName = true,
5454
HelpMessage = "Vault name. Cmdlet constructs the FQDN of a vault based on the name and currently selected environment.")]
55+
[Alias(Constants.Name)]
5556
[ValidateNotNullOrEmpty]
5657
public string VaultName { get; set; }
5758

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/UndoAzureKeyVaultKeyRemoval.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace Microsoft.Azure.Commands.KeyVault
1919
{
2020
[Cmdlet(VerbsCommon.Undo, "AzureKeyVaultKeyRemoval",
2121
SupportsShouldProcess = true,
22-
ConfirmImpact = ConfirmImpact.Low,
2322
HelpUri = Constants.KeyVaultHelpUri)]
2423
[OutputType(typeof(KeyBundle))]
2524
public class UndoAzureKeyVaultKeyRemoval : KeyVaultCmdletBase

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/UndoAzureKeyVaultRemoval.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace Microsoft.Azure.Commands.KeyVault
2121
{
2222
[Cmdlet(VerbsCommon.Undo, "AzureRmKeyVaultRemoval",
2323
SupportsShouldProcess = true,
24-
ConfirmImpact = ConfirmImpact.Low,
2524
HelpUri = Constants.KeyVaultHelpUri)]
2625
[OutputType(typeof(PSKeyVaultModels.PSVault))]
2726
public class UndoAzureKeyVaultRemoval : KeyVaultManagementCmdletBase

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/UndoAzureKeyVaultSecretRemoval.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace Microsoft.Azure.Commands.KeyVault
1919
{
2020
[Cmdlet(VerbsCommon.Undo, "AzureKeyVaultSecretRemoval",
2121
SupportsShouldProcess = true,
22-
ConfirmImpact = ConfirmImpact.Low,
2322
HelpUri = Constants.KeyVaultHelpUri)]
2423
[OutputType(typeof(Secret))]
2524
public class UndoAzureKeyVaultSecretRemoval : KeyVaultCmdletBase

0 commit comments

Comments
 (0)