Skip to content

Commit 3ea6aef

Browse files
authored
Merge pull request #2708 from Azure/update-rm-confirm
Update default ConfirmAction execution
2 parents 698277c + b517e1c commit 3ea6aef

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ protected override AzureContext DefaultContext
8585
}
8686
}
8787

88+
/// <summary>
89+
/// Guards execution of the given action using ShouldProcess and ShouldContinue. The optional
90+
/// useSHouldContinue predicate determines whether SHouldContinue should be called for this
91+
/// particular action (e.g. a resource is being overwritten). By default, both
92+
/// ShouldProcess and ShouldContinue will be executed. Cmdlets that use this method overload
93+
/// must have a force parameter.
94+
/// </summary>
95+
/// <param name="force">Do not ask for confirmation</param>
96+
/// <param name="continueMessage">Message to describe the action</param>
97+
/// <param name="processMessage">Message to prompt after the active is performed.</param>
98+
/// <param name="target">The target name.</param>
99+
/// <param name="action">The action code</param>
100+
protected override void ConfirmAction(bool force, string continueMessage, string processMessage, string target,
101+
Action action)
102+
{
103+
ConfirmAction(force, continueMessage, processMessage, target, action, () => true);
104+
}
105+
88106
/// <summary>
89107
/// Prompt for confirmation for the specified change to the specified ARM resource
90108
/// </summary>

src/Storage/Commands.Storage/Blob/Cmdlet/RemoveAzureStorageContainerStoredAccessPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ internal bool RemoveAzureContainerStoredAccessPolicy(IStorageBlobManagement loca
9393
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
9494
public override void ExecuteCmdlet()
9595
{
96-
WriteWarning("Force parameter in this cmdlet will be removed in a future release.");
97-
9896
if (String.IsNullOrEmpty(Container) || String.IsNullOrEmpty(Policy)) return;
9997
bool success = RemoveAzureContainerStoredAccessPolicy(Channel, Container, Policy);
10098
string result = string.Empty;

src/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShareStoredAccessPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ internal bool RemoveAzureShareStoredAccessPolicy(IStorageFileManagement localCha
7676
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
7777
public override void ExecuteCmdlet()
7878
{
79-
WriteWarning("Force parameter in this cmdlet will be removed in a future release.");
80-
8179
bool success = RemoveAzureShareStoredAccessPolicy(Channel, ShareName, Policy);
8280
string result = string.Empty;
8381

src/Storage/Commands.Storage/Queue/Cmdlet/RemoveAzureStorageQueueStoredAccessPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ internal bool RemoveAzureQueueStoredAccessPolicy(IStorageQueueManagement localCh
9191
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
9292
public override void ExecuteCmdlet()
9393
{
94-
WriteWarning("Force parameter in this cmdlet will be removed in a future release.");
95-
9694
if (String.IsNullOrEmpty(Queue) || String.IsNullOrEmpty(Policy)) return;
9795
bool success = RemoveAzureQueueStoredAccessPolicy(Channel, Queue, Policy);
9896
string result = string.Empty;

src/Storage/Commands.Storage/Table/Cmdlet/RemoveAzureStorageTableStoredAccessPolicy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ internal bool RemoveAzureTableStoredAccessPolicy(IStorageTableManagement localCh
9191
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
9292
public override void ExecuteCmdlet()
9393
{
94-
WriteWarning("Force parameter in this cmdlet will be removed in a future release.");
95-
9694
if (String.IsNullOrEmpty(Table) || String.IsNullOrEmpty(Policy)) return;
9795
bool success = RemoveAzureTableStoredAccessPolicy(Channel, Table, Policy);
9896
string result = string.Empty;

0 commit comments

Comments
 (0)