Skip to content

Commit adb7dd7

Browse files
committed
renaming some parameters of jobschedule cmdlets
1 parent a6d4139 commit adb7dd7

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<Compile Include="UnitTests\GetAzureAutomationScheduledRunbookTest.cs" />
9898
<Compile Include="UnitTests\NewAzureAutomationRunbookTest.cs" />
9999
<Compile Include="UnitTests\PublishAzureAutomationRunbookTest.cs" />
100-
<Compile Include="UnitTests\RegisterAzureAutomationScheduledRunbook.cs" />
100+
<Compile Include="UnitTests\RegisterAzureAutomationScheduledRunbookTest.cs" />
101101
<Compile Include="UnitTests\RemoveAzureAutomationRunbookTest.cs" />
102102
<Compile Include="UnitTests\SetAzureAutomationRunbookDefinitionTest.cs" />
103103
<Compile Include="UnitTests\SetAzureAutomationRunbookTest.cs" />
@@ -137,7 +137,7 @@
137137
<ItemGroup>
138138
<None Include="MSSharedLibKey.snk" />
139139
<None Include="packages.config" />
140-
<Compile Include="UnitTests\UnregisterAzureAutomationScheduledRunbook.cs" />
140+
<Compile Include="UnitTests\UnregisterAzureAutomationScheduledRunbookTest.cs" />
141141
</ItemGroup>
142142
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
143143
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
5656

5757
// Test
5858
this.cmdlet.AutomationAccountName = accountName;
59-
this.cmdlet.Name = runbookName;
59+
this.cmdlet.RunbookName = runbookName;
6060
this.cmdlet.ScheduleName = scheduleName;
6161
this.cmdlet.ExecuteCmdlet();
6262

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void UnregisterAzureAutomationScheduledRunbookByRunbookNameAndScheduleNam
7676

7777
// Test
7878
this.cmdlet.AutomationAccountName = accountName;
79-
this.cmdlet.Name = runbookName;
79+
this.cmdlet.RunbookName = runbookName;
8080
this.cmdlet.ScheduleName = scheduleName;
8181
this.cmdlet.SetParameterSet(AutomationCmdletParameterSets.ByRunbookNameAndScheduleName);
8282
this.cmdlet.Force = true;

src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationScheduledRunbook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ public class GetAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
3232
/// Gets or sets the job id.
3333
/// </summary>
3434
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByJobScheduleId, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The job schedule id.")]
35-
[Alias("JobScheduleId")]
3635
public Guid? Id { get; set; }
3736

3837
/// <summary>
3938
/// Gets or sets the runbook name of the job.
4039
/// </summary>
4140
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookName, Mandatory = true, HelpMessage = "The runbook name of the job schedule.")]
4241
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = true, HelpMessage = "The runbook name of the job schedule.")]
42+
[Alias("Name")]
4343
public string RunbookName { get; set; }
4444

4545
/// <summary>

src/ServiceManagement/Automation/Commands.Automation/Cmdlet/RegisterAzureAutomationScheduledRunbook.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,30 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet
2424
/// Registers an azure automation scheduled runbook.
2525
/// </summary>
2626
[Cmdlet(VerbsLifecycle.Register, "AzureAutomationScheduledRunbook", DefaultParameterSetName = AutomationCmdletParameterSets.ByRunbookName)]
27-
[OutputType(typeof(Runbook))]
27+
[OutputType(typeof(JobSchedule))]
2828
public class RegisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
2929
{
3030
/// <summary>
3131
/// Gets or sets the runbook name
3232
/// </summary>
33-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookName, Mandatory = true, ValueFromPipelineByPropertyName = true,
33+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = true, ValueFromPipelineByPropertyName = true,
3434
HelpMessage = "The runbook name.")]
3535
[ValidateNotNullOrEmpty]
36-
[Alias("RunbookName")]
37-
public string Name { get; set; }
36+
[Alias("Name")]
37+
public string RunbookName { get; set; }
3838

3939
/// <summary>
4040
/// Gets or sets the schedule that will be used to start the runbook.
4141
/// </summary>
42-
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
42+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = true, ValueFromPipelineByPropertyName = true,
4343
HelpMessage = "The name of the schedule on which the runbook will be started.")]
4444
[ValidateNotNullOrEmpty]
4545
public string ScheduleName { get; set; }
4646

4747
/// <summary>
4848
/// Gets or sets the runbook parameters.
4949
/// </summary>
50-
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true,
50+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = false, ValueFromPipelineByPropertyName = true,
5151
HelpMessage = "The runbook parameters.")]
5252
public IDictionary Parameters { get; set; }
5353

@@ -60,7 +60,7 @@ protected override void AutomationExecuteCmdlet()
6060
JobSchedule jobSchedule;
6161

6262
jobSchedule = this.AutomationClient.RegisterScheduledRunbook(
63-
this.AutomationAccountName, this.Name, this.ScheduleName, this.Parameters);
63+
this.AutomationAccountName, this.RunbookName, this.ScheduleName, this.Parameters);
6464

6565
this.WriteObject(jobSchedule);
6666
}

src/ServiceManagement/Automation/Commands.Automation/Cmdlet/UnregisterAzureAutomationScheduledRunbook.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ namespace Microsoft.Azure.Commands.Automation.Cmdlet
2626
/// Unregisters an azure automation scheduled runbook.
2727
/// </summary>
2828
[Cmdlet(VerbsLifecycle.Unregister, "AzureAutomationScheduledRunbook", DefaultParameterSetName = AutomationCmdletParameterSets.ByJobScheduleId)]
29-
[OutputType(typeof(Runbook))]
3029
public class UnregisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdlet
3130
{
3231
/// <summary>
3332
/// Gets or sets the runbook Id
3433
/// </summary>
3534
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByJobScheduleId, Mandatory = true, ValueFromPipelineByPropertyName = true,
3635
HelpMessage = "The job schedule id.")]
37-
[Alias("JobScheduleId")]
3836
public Guid? Id { get; set; }
3937

4038
/// <summary>
@@ -43,8 +41,8 @@ public class UnregisterAzureAutomationScheduledRunbook : AzureAutomationBaseCmdl
4341
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByRunbookNameAndScheduleName, Mandatory = true, ValueFromPipelineByPropertyName = true,
4442
HelpMessage = "The runbook name.")]
4543
[ValidateNotNullOrEmpty]
46-
[Alias("RunbookName")]
47-
public string Name { get; set; }
44+
[Alias("Name")]
45+
public string RunbookName { get; set; }
4846

4947
/// <summary>
5048
/// Gets or sets the schedule that will be used to start the runbook.
@@ -70,7 +68,7 @@ protected override void AutomationExecuteCmdlet()
7068
this.Force.IsPresent,
7169
string.Format(CultureInfo.CurrentCulture, Resources.RemoveAzureAutomationJobScheduleWarning),
7270
string.Format(CultureInfo.CurrentCulture, Resources.RemoveAzureAutomationJobScheduleDescription),
73-
this.Id.HasValue ? this.Id.Value.ToString() : this.Name,
71+
this.Id.HasValue ? this.Id.Value.ToString() : this.RunbookName,
7472
() =>
7573
{
7674
if (this.ParameterSetName == AutomationCmdletParameterSets.ByJobScheduleId)
@@ -81,7 +79,7 @@ protected override void AutomationExecuteCmdlet()
8179
else if (this.ParameterSetName == AutomationCmdletParameterSets.ByRunbookNameAndScheduleName)
8280
{
8381
this.AutomationClient.UnregisterScheduledRunbook(
84-
this.AutomationAccountName, this.Name, this.ScheduleName);
82+
this.AutomationAccountName, this.RunbookName, this.ScheduleName);
8583
}
8684
});
8785
}

0 commit comments

Comments
 (0)