Skip to content

Commit 38b63c6

Browse files
fix new account sku
1 parent 6a0f662 commit 38b63c6

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet
2424
/// <summary>
2525
/// Gets azure automation accounts, filterd by automation account name and location.
2626
/// </summary>
27-
[Cmdlet(VerbsCommon.Get, "AzureAutomationAccount")]
27+
[Cmdlet(VerbsCommon.Get, "AzureAutomationAccount", DefaultParameterSetName = AutomationCmdletParameterSets.ByAll)]
2828
[OutputType(typeof(AutomationAccount))]
2929
public class GetAzureAutomationAccount : AzureAutomationBaseCmdlet
3030
{
3131
/// <summary>
3232
/// Gets or sets the automation account name.
3333
/// </summary>
34-
[Parameter(Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The automation account name.")]
34+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAutomationAccountName, Position = 1, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The automation account name.")]
3535
[Alias("AutomationAccountName")]
3636
[ValidateNotNullOrEmpty]
3737
public string Name { get; set; }

src/ResourceManager/Automation/Commands.Automation/Common/AutomationClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public Model.AutomationAccount CreateAutomationAccount(string resourceGroupName,
115115
Sku = new Sku()
116116
{
117117
// todo take input
118-
Family = "Free"
118+
Name = "Free",
119+
Capacity = 1,
119120
}
120121
}
121122
};

src/ResourceManager/Automation/Commands.Automation/Model/AutomationAccount.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System;
1516
using Microsoft.Azure.Commands.Automation.Common;
1617

1718
namespace Microsoft.Azure.Commands.Automation.Model
@@ -40,7 +41,12 @@ public AutomationAccount(string resourceGroupName, AutomationManagement.Models.A
4041
this.ResourceGroupName = resourceGroupName;
4142
this.AutomationAccountName = automationAccount.Name;
4243
this.Location = automationAccount.Location;
43-
this.Plan = automationAccount.Properties.Sku.Family;
44+
45+
if (automationAccount.Properties == null) return;
46+
47+
this.Plan = automationAccount.Properties.Sku != null ? automationAccount.Properties.Sku.Name : null;
48+
this.CreationTime = automationAccount.Properties.CreationTime.ToLocalTime();
49+
this.LastModifiedTime = automationAccount.Properties.LastModifiedTime.ToLocalTime();
4450
}
4551

4652
/// <summary>
@@ -74,5 +80,15 @@ public AutomationAccount()
7480
/// Gets or sets the plan.
7581
/// </summary>
7682
public string Plan { get; set; }
83+
84+
/// <summary>
85+
/// Gets or sets the CreationTime.
86+
/// </summary>
87+
public DateTimeOffset CreationTime { get; set; }
88+
89+
/// <summary>
90+
/// Gets or sets the LastPublishTime.
91+
/// </summary>
92+
public DateTimeOffset LastModifiedTime { get; set; }
7793
}
7894
}

0 commit comments

Comments
 (0)