Skip to content

Commit 40b333f

Browse files
2 parents b1f844b + b0b31cf commit 40b333f

14 files changed

+486
-337
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class ExportAzureAutomationDscNodeReportContent : AzureAutomationBaseCmdl
4646
/// Gets or sets the report id.
4747
/// </summary>
4848
[Parameter(Mandatory = true, ParameterSetName = AutomationCmdletParameterSets.ByAll, ValueFromPipelineByPropertyName = true, HelpMessage = "The dsc node report id.")]
49+
[Alias("Id")]
4950
public Guid ReportId { get; set; }
5051

5152
/// <summary>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class GetAzureAutomationDscConfiguration : AzureAutomationBaseCmdlet
3131
/// <summary>
3232
/// Gets or sets the configuration name.
3333
/// </summary>
34-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, Position = 2, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The configuration name.")]
34+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, Position = 2, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The configuration name.")]
3535
[Alias("ConfigurationName")]
3636
[ValidateNotNullOrEmpty]
3737
public string Name { get; set; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class GetAzureAutomationDscCompilationJobOutput : AzureAutomationBaseCmdl
3838
public Guid Id { get; set; }
3939

4040
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The stream type.")]
41-
[ValidateSet("Warning", "Error", "Debug", "Verbose", "Any")]
41+
[ValidateSet("Warning", "Error", "Verbose", "Any", IgnoreCase = true)]
4242
public CompilationJobStreamType Stream { get; set; }
4343

4444
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Retrieves output created after this time")]

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ public class GetAzureAutomationDscNode : AzureAutomationBaseCmdlet
4242
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByName, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
4343
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByNodeConfiguration, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
4444
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter dsc nodes based on their status.")]
45-
[ValidateSet("Any", "Compliant", "NotCompliant", "Failed", "Pending", "Received", "Unresponsive")]
45+
[ValidateSet("Compliant", "NotCompliant", "Failed", "Pending", "Received", "Unresponsive", IgnoreCase = true)]
4646
public DscNodeStatus Status { get; set; }
4747

4848
/// <summary>
4949
/// Gets or sets the node name.
5050
/// </summary>
51-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByName, Mandatory = true, ValueFromPipeline = true, HelpMessage = "The node name.")]
51+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The node name.")]
5252
[ValidateNotNullOrEmpty]
53+
[Alias("NodeName")]
5354
public string Name { get; set; }
5455

5556
/// <summary>
5657
/// Gets or sets the nodeconfiguration name.
5758
/// </summary>
5859
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByNodeConfiguration, Mandatory = true, HelpMessage = "Filter dsc nodes based on their node configuration name.")]
59-
[ValidateNotNullOrEmpty]
6060
public string NodeConfigurationName { get; set; }
6161

6262
/// <summary>
@@ -75,9 +75,9 @@ public override void ExecuteCmdlet()
7575
IEnumerable<DscNode> ret = null;
7676

7777
var nodeStatus = this.Status.ToString();
78-
if (nodeStatus.Equals(DscNodeStatus.Any))
78+
if (nodeStatus.Equals("0"))
7979
{
80-
nodeStatus = string.Empty;
80+
nodeStatus = null;
8181
}
8282

8383
if (this.ParameterSetName == AutomationCmdletParameterSets.ById)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@ public class GetAzureAutomationDscNodeConfiguration : AzureAutomationBaseCmdlet
4040
/// <summary>
4141
/// Gets or sets the runbook name of the job.
4242
/// </summary>
43-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, Mandatory = true, HelpMessage = "The configuration name.")]
43+
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "The configuration name.")]
4444
public string ConfigurationName { get; set; }
4545

4646
/// <summary>
4747
/// Gets or sets the status of a job.
4848
/// </summary>
4949
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByConfigurationName, Mandatory = false, HelpMessage = "Filter node configurations by RollupStatus.")]
50-
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByNodeConfigurationName, Mandatory = false, HelpMessage = "Filter node configurations by RollupStatus.")]
5150
[Parameter(ParameterSetName = AutomationCmdletParameterSets.ByAll, Mandatory = false, HelpMessage = "Filter node configurations by RollupStatus.")]
52-
[ValidateSet("Good", "Bad")]
51+
[ValidateSet("Good", "Bad", IgnoreCase = true)]
5352
public string RollupStatus { get; set; }
5453

5554
/// <summary>
@@ -60,9 +59,8 @@ protected override void AutomationExecuteCmdlet()
6059
{
6160
IEnumerable<NodeConfiguration> nodeConfigurations;
6261

63-
if (this.Name != null && !Guid.Empty.Equals(this.Name))
62+
if (this.Name != null)
6463
{
65-
// ByJobId
6664
nodeConfigurations = new List<NodeConfiguration> { this.AutomationClient.GetNodeConfiguration(this.ResourceGroupName, this.AutomationAccountName, this.Name, this.RollupStatus) };
6765
}
6866
else if (this.ConfigurationName != null)

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

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ public class RegisterAzureAutomationDscNode : AzureAutomationBaseCmdlet
6767
/// </summary>
6868
private string configurationMode = "ApplyAndMonitor";
6969

70+
/// <summary>
71+
/// Default value for AzureVMResourceGroup
72+
/// </summary>
73+
private string azureVmResourceGroup = String.Empty;
74+
75+
/// <summary>
76+
/// Default value for AzureVmLocation
77+
/// </summary>
78+
private string azureVmLocation = String.Empty;
79+
7080
/// <summary>
7181
/// Gets or sets the VM name.
7282
/// </summary>
@@ -88,7 +98,7 @@ public string NodeConfigurationName
8898
/// Gets or sets the configuration mode
8999
/// </summary>
90100
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "DSC configuration mode.")]
91-
[ValidateSet("ApplyAndMonitor", "ApplyAndAutocorrect", "ApplyOnly")]
101+
[ValidateSet("ApplyAndMonitor", "ApplyAndAutocorrect", "ApplyOnly", IgnoreCase = true)]
92102
public string ConfigurationMode
93103
{
94104
get { return this.configurationMode; }
@@ -111,10 +121,10 @@ public int ConfigurationModeFrequencyMins
111121
/// </summary>
112122
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Represents the frequency (in minutes) at which the Local Configuration Manager contacts the Azure Automation DSC pull server to download the latest node configuration.")]
113123
[ValidateRange(30, 44640)]
114-
public int RefreshFrequencyMins
124+
public int RefreshFrequencyMins
115125
{
116126
get { return this.refreshFrequencyMins; }
117-
set { this.refreshFrequencyMins = value; }
127+
set { this.refreshFrequencyMins = value; }
118128
}
119129

120130
/// <summary>
@@ -131,7 +141,7 @@ public bool RebootNodeIfNeeded
131141
/// Gets or sets the action to perform post reboot.
132142
/// </summary>
133143
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Action to perform after a reboot.")]
134-
[ValidateSet("ContinueConfiguration", "StopConfiguration")]
144+
[ValidateSet("ContinueConfiguration", "StopConfiguration", IgnoreCase = true)]
135145
public string ActionAfterReboot
136146
{
137147
get { return this.actionAfterReboot; }
@@ -149,13 +159,33 @@ public bool AllowModuleOverwrite
149159
set { this.overwriteModulesFlag = value; }
150160
}
151161

162+
/// <summary>
163+
/// Gets or sets the azure VM resource group name.
164+
/// </summary>
165+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Azure VM resource group name.")]
166+
public string AzureVMResourceGroup
167+
{
168+
get { return this.azureVmResourceGroup; }
169+
set { this.azureVmResourceGroup = value; }
170+
}
171+
172+
/// <summary>
173+
/// Gets or sets the azure VM location.
174+
/// </summary>
175+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The Azure VM location.")]
176+
public string AzureVMLocation
177+
{
178+
get { return this.azureVmLocation; }
179+
set { this.azureVmLocation = value; }
180+
}
181+
152182
/// <summary>
153183
/// Execute this cmdlet.
154184
/// </summary>
155185
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
156186
public override void ExecuteCmdlet()
157187
{
158-
this.AutomationClient.RegisterDscNode(this.ResourceGroupName, this.AutomationAccountName,this.AzureVMName, this.NodeConfigurationName, this.ConfigurationMode, this.ConfigurationModeFrequencyMins, this.RefreshFrequencyMins, this.RebootNodeIfNeeded, this.ActionAfterReboot, this.AllowModuleOverwrite);
188+
this.AutomationClient.RegisterDscNode(this.ResourceGroupName, this.AutomationAccountName, this.AzureVMName, this.NodeConfigurationName, this.ConfigurationMode, this.ConfigurationModeFrequencyMins, this.RefreshFrequencyMins, this.RebootNodeIfNeeded, this.ActionAfterReboot, this.AllowModuleOverwrite, this.AzureVMResourceGroup, this.AzureVMLocation);
159189
}
160190
}
161191
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class StartAzureAutomationDscCompilationJob : AzureAutomationBaseCmdlet
3939
/// <summary>
4040
/// Gets or sets the configuration parameters.
4141
/// </summary>
42-
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The compilation job parameters.")]
42+
[Parameter(Mandatory = false, HelpMessage = "The compilation job parameters.")]
4343
public IDictionary Parameters { get; set; }
4444

4545
/// <summary>

0 commit comments

Comments
 (0)