Skip to content

Commit b0b31cf

Browse files
Merge pull request #5 from balukambala/ignite
Fixed dsc bugs
2 parents 1c56062 + 7b43679 commit b0b31cf

12 files changed

+432
-327
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", IgnoreCase = true)]
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/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)