Skip to content

Commit 7b43679

Browse files
committed
fixed an issue with piping in export report content
1 parent 139de31 commit 7b43679

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
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/Common/AutomationClientDSC.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ public Model.DscNodeReport GetDscNodeReportByReportId(string resourceGroupName,
11511151
nodeId,
11521152
reportId).NodeReport;
11531153

1154-
return new Model.DscNodeReport(resourceGroupName, automationAccountName, nodeReport);
1154+
return new Model.DscNodeReport(resourceGroupName, automationAccountName, nodeId.ToString("D"), nodeReport);
11551155
}
11561156
}
11571157

@@ -1211,7 +1211,7 @@ public Model.DscNodeReport GetLatestDscNodeReport(string resourceGroupName, stri
12111211
new DscNodeReportListParameters { NodeId = nodeId }
12121212
).NodeReports.OrderByDescending(report => report.StartTime).FirstOrDefault();
12131213

1214-
return new Model.DscNodeReport(resourceGroupName, automationAccountName, nodeReport);
1214+
return new Model.DscNodeReport(resourceGroupName, automationAccountName, nodeId.ToString("D"), nodeReport);
12151215
}
12161216
}
12171217

@@ -1294,7 +1294,7 @@ public Model.DscNodeReport GetLatestDscNodeReport(string resourceGroupName, stri
12941294
});
12951295
}
12961296

1297-
return nodeReportModels.Select(jobModel => new Commands.Automation.Model.DscNodeReport(resourceGroupName, automationAccountName, jobModel));
1297+
return nodeReportModels.Select(jobModel => new Commands.Automation.Model.DscNodeReport(resourceGroupName, automationAccountName, nodeId.ToString("D"), jobModel));
12981298
}
12991299
}
13001300
#endregion

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ public class DscNodeReport
2929
/// </summary>
3030
/// <param name="resourceGroupName">The resource group name.</param>
3131
/// <param name="automationAccountName">The automation account.</param>
32+
/// <param name="nodeId">The Node Id.</param>
3233
/// <param name="dscNodeReport">The dsc node report.</param>
33-
public DscNodeReport(string resourceGroupName, string automationAccountName, AutomationManagement.Models.DscNodeReport dscNodeReport)
34+
public DscNodeReport(string resourceGroupName, string automationAccountName, string nodeId, AutomationManagement.Models.DscNodeReport dscNodeReport)
3435
{
3536
Requires.Argument("ResourceGroupName", resourceGroupName).NotNull();
3637
Requires.Argument("AutomationAccountName", automationAccountName).NotNull();
@@ -43,6 +44,7 @@ public DscNodeReport(string resourceGroupName, string automationAccountName, Aut
4344
this.LastModifiedTime = dscNodeReport.LastModifiedTime;
4445
this.ReportType = dscNodeReport.Type;
4546
this.Id = dscNodeReport.Id;
47+
this.NodeId = nodeId;
4648
}
4749

4850
/// <summary>
@@ -83,8 +85,13 @@ public DscNodeReport()
8385
public string ReportType { get; set; }
8486

8587
/// <summary>
86-
/// Gets or sets the id of the node report.
88+
/// Gets or sets the report id.
8789
/// </summary>
8890
public string Id { get; set; }
91+
92+
/// <summary>
93+
/// Gets or sets the Node id.
94+
/// </summary>
95+
public string NodeId { get; set; }
8996
}
9097
}

0 commit comments

Comments
 (0)