Skip to content

Commit ccff761

Browse files
AccountName param moved to base class
1 parent 17fc543 commit ccff761

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/ResourceManager/Automation/Commands.Automation/Cmdlet/SetAzureAutomationAccount.cs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,38 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet
2525
/// <summary>
2626
/// Creates azure automation accounts based on automation account name and location.
2727
/// </summary>
28-
[Cmdlet(VerbsCommon.Set, "AzureAutomationAccount", DefaultParameterSetName = AutomationCmdletParameterSets.ByName)]
28+
[Cmdlet(VerbsCommon.Set, "AzureAutomationAccount")]
2929
[OutputType(typeof(AutomationAccount))]
30-
public class SetAzureAutomationAccount : AzureAutomationBaseCmdlet
30+
public class SetAzureAutomationAccount : AzurePSCmdlet
3131
{
32+
/// <summary>
33+
/// The automation client.
34+
/// </summary>
35+
private IAutomationClient automationClient;
36+
37+
/// <summary>
38+
/// Gets or sets the automation client base.
39+
/// </summary>
40+
public IAutomationClient AutomationClient
41+
{
42+
get
43+
{
44+
return this.automationClient = this.automationClient ?? new AutomationClient(Profile, Profile.Context.Subscription);
45+
}
46+
47+
set
48+
{
49+
this.automationClient = value;
50+
}
51+
}
52+
53+
/// <summary>
54+
/// Gets or sets the automation account name.
55+
/// </summary>
56+
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
57+
[ValidateNotNullOrEmpty]
58+
public string ResourceGroupName { get; set; }
59+
3260
/// <summary>
3361
/// Gets or sets the automation account name.
3462
/// </summary>

0 commit comments

Comments
 (0)