Skip to content

Commit d15b1ac

Browse files
added "type" info
1 parent cb9b2df commit d15b1ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

functions/Get-DbaAgentJobHistory.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,13 @@ function Get-DbaAgentJobHistory {
269269
}
270270
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name OutputFileName -value $outname
271271
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name RemoteOutputFileName -value $outremote
272-
Select-DefaultView -InputObject $execution -Property ComputerName, InstanceName, SqlInstance, 'JobName as Job', StepName, RunDate, StartDate, EndDate, Duration, Status, OperatorEmailed, Message, OutputFileName, RemoteOutputFileName
272+
# Add this in for easier ConvertTo-DbaTimeline Support
273+
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name TypeName -value AgentJobHistory
274+
Select-DefaultView -InputObject $execution -Property ComputerName, InstanceName, SqlInstance, 'JobName as Job', StepName, RunDate, StartDate, EndDate, Duration, Status, OperatorEmailed, Message, OutputFileName, RemoteOutputFileName -TypeName AgentJobHistory
273275
}
274276
else {
275-
Select-DefaultView -InputObject $execution -Property ComputerName, InstanceName, SqlInstance, 'JobName as Job', StepName, RunDate, StartDate, EndDate, Duration, Status, OperatorEmailed, Message
277+
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name TypeName -value AgentJobHistory
278+
Select-DefaultView -InputObject $execution -Property ComputerName, InstanceName, SqlInstance, 'JobName as Job', StepName, RunDate, StartDate, EndDate, Duration, Status, OperatorEmailed, Message -TypeName AgentJobHistory
276279
}
277280

278281
}

0 commit comments

Comments
 (0)