Skip to content

Commit 6b4f696

Browse files
author
begoldsm
committed
Add Should process and update help.
1 parent f8704da commit 6b4f696

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Commands/EnableAzureRmDataLakeStoreKeyVault.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.DataLakeStore.Models;
16+
using Microsoft.Azure.Commands.DataLakeStore.Properties;
1617
using System.Management.Automation;
1718

1819
namespace Microsoft.Azure.Commands.DataLakeStore
1920
{
20-
[Cmdlet(VerbsLifecycle.Enable, "AzureRmDataLakeStoreKeyVault")]
21+
[Cmdlet(VerbsLifecycle.Enable, "AzureRmDataLakeStoreKeyVault", SupportsShouldProcess = true)]
2122
[Alias("Enable-AdlStoreKeyVault")]
2223
public class EnableAzureDataLakeStoreKeyVault : DataLakeStoreCmdletBase
2324
{
@@ -34,7 +35,10 @@ public class EnableAzureDataLakeStoreKeyVault : DataLakeStoreCmdletBase
3435

3536
public override void ExecuteCmdlet()
3637
{
37-
DataLakeStoreClient.EnableKeyVault(ResourceGroupName, Account);
38+
ConfirmAction(
39+
string.Format(Resources.EnableKeyVault, Account),
40+
Account,
41+
() => DataLakeStoreClient.EnableKeyVault(ResourceGroupName, Account));
3842
}
3943
}
4044
}

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@
141141
<data name="DownloadFileDataMessage" xml:space="preserve">
142142
<value>Download file data</value>
143143
</data>
144+
<data name="EnableKeyVault" xml:space="preserve">
145+
<value>Enabling user supplied KeyVault to the Data Lake Store Account: '{0}' ...</value>
146+
</data>
144147
<data name="FailedToDiscoverResourceGroup" xml:space="preserve">
145148
<value>Could not find account: '{0}' in any resource group in the currently selected subscription: {1}. Please ensure this account exists and that the current user has access to it.</value>
146149
</data>

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/help/Enable-AzureRmDataLakeStoreKeyVault.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Attempts to enable a user managed Key Vault for encryption of the specified Data
1212
## SYNTAX
1313

1414
```
15-
Enable-AzureRmDataLakeStoreKeyVault [-Account] <String> [-ResourceGroupName <String>] [<CommonParameters>]
15+
Enable-AzureRmDataLakeStoreKeyVault [-Account] <String> [-ResourceGroupName <String>] [-WhatIf] [-Confirm]
16+
[<CommonParameters>]
1617
```
1718

1819
## DESCRIPTION
@@ -59,6 +60,36 @@ Accept pipeline input: True (ByPropertyName)
5960
Accept wildcard characters: False
6061
```
6162
63+
### -Confirm
64+
Prompts you for confirmation before running the cmdlet.
65+
66+
```yaml
67+
Type: SwitchParameter
68+
Parameter Sets: (All)
69+
Aliases: cf
70+
71+
Required: False
72+
Position: Named
73+
Default value: None
74+
Accept pipeline input: False
75+
Accept wildcard characters: False
76+
```
77+
78+
### -WhatIf
79+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
80+
81+
```yaml
82+
Type: SwitchParameter
83+
Parameter Sets: (All)
84+
Aliases: wi
85+
86+
Required: False
87+
Position: Named
88+
Default value: None
89+
Accept pipeline input: False
90+
Accept wildcard characters: False
91+
```
92+
6293
### CommonParameters
6394
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
6495

0 commit comments

Comments
 (0)