Skip to content

Commit dc39d37

Browse files
Enable needs to have the ShouldProcess on the reactiveAzureBatchTask cmdlet and SupportsShouldProcess = true
1 parent 14151cf commit dc39d37

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ResourceManager/AzureBatch/Commands.Batch/Tasks/EnableBatchTaskCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace Microsoft.Azure.Commands.Batch
2020
{
21-
[Cmdlet(VerbsLifecycle.Enable, Constants.AzureBatchTask)]
21+
[Cmdlet(VerbsLifecycle.Enable, Constants.AzureBatchTask, SupportsShouldProcess = true)]
2222
[Alias("Reactivate-AzureBatchTask")]
2323
public class EnableBatchTaskCommand : BatchObjectModelCmdletBase
2424
{
@@ -41,7 +41,10 @@ public override void ExecuteCmdlet()
4141
{
4242
TaskOperationParameters parameters = new TaskOperationParameters(this.BatchContext, this.JobId, this.Id, this.Task, this.AdditionalBehaviors);
4343

44-
this.BatchClient.ReactivateTask(parameters);
44+
if (ShouldProcess(Constants.AzureBatchTask))
45+
{
46+
this.BatchClient.ReactivateTask(parameters);
47+
}
4548
}
4649
}
4750
}

0 commit comments

Comments
 (0)