Skip to content

Commit 0092fd4

Browse files
committed
addressed review comments
1 parent 69b09d8 commit 0092fd4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/ResourceManager/Insights/Commands.Insights/ActionGroups/SetAzureRmActionGroupCommand.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class SetAzureRmActionGroupCommand : ManagementCmdletBase
5959
/// </summary>
6060
[Parameter(ParameterSetName = ByPropertyName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The action group short name")]
6161
[Parameter(ParameterSetName = ByResourceId, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The action group short name")]
62+
[Parameter(ParameterSetName = ByInputObject, Mandatory = false, HelpMessage = "The action group short name")]
6263
[ValidateNotNullOrEmpty]
6364
public string ShortName { get; set; }
6465

@@ -74,13 +75,15 @@ public class SetAzureRmActionGroupCommand : ManagementCmdletBase
7475
/// </summary>
7576
[Parameter(ParameterSetName = ByPropertyName, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Whether or not the action group should be enabled")]
7677
[Parameter(ParameterSetName = ByResourceId, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Whether or not the action group should be enabled")]
78+
[Parameter(ParameterSetName = ByInputObject, Mandatory = false, HelpMessage = "Whether or not the action group should be enabled")]
7779
public SwitchParameter DisableGroup { get; set; }
7880

7981
/// <summary>
8082
/// Gets or sets the Tags of the activity log alert resource
8183
/// </summary>
8284
[Parameter(ParameterSetName = ByPropertyName, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The tags of the action group resource")]
83-
[Parameter(ParameterSetName = ByResourceId, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Whether or not the action group should be enabled")]
85+
[Parameter(ParameterSetName = ByResourceId, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The tags of the action group resource")]
86+
[Parameter(ParameterSetName = ByInputObject, Mandatory = false, ValueFromPipeline = true, HelpMessage = "The tags of the action group resource")]
8487
[ValidateNotNullOrEmpty]
8588
public IDictionary<string, string> Tag { get; set; }
8689

@@ -109,9 +112,18 @@ protected override void ProcessRecordInternal()
109112
if (ParameterSetName == ByInputObject)
110113
{
111114
this.ResourceGroupName = this.InputObject.ResourceGroupName;
112-
this.ShortName = this.InputObject.GroupShortName;
113-
this.DisableGroup = !this.InputObject.Enabled;
114-
this.Tag = this.InputObject.Tags;
115+
if (this.ShortName == null)
116+
{
117+
this.ShortName = this.InputObject.GroupShortName;
118+
}
119+
if (!this.DisableGroup.IsPresent)
120+
{
121+
this.DisableGroup = !this.InputObject.Enabled;
122+
}
123+
if (this.Tag == null)
124+
{
125+
this.Tag = this.InputObject.Tags;
126+
}
115127
this.Receiver = new List<PSActionGroupReceiverBase>();
116128
this.Receiver.AddRange(this.InputObject.EmailReceivers);
117129
this.Receiver.AddRange(this.InputObject.SmsReceivers);

0 commit comments

Comments
 (0)