Skip to content

Commit

Permalink
Merge pull request #5157 from SQLGB/patch-1
Browse files Browse the repository at this point in the history
Update Get-DbaAgentJobHistory.ps1
  • Loading branch information
potatoqualitee authored Mar 7, 2019
2 parents aae0b15 + 1ab639c commit d71dd73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/Get-DbaAgentJobHistory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function Get-DbaAgentJobHistory {
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name ComputerName -value $server.ComputerName
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name InstanceName -value $server.ServiceName
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name SqlInstance -value $server.DomainInstanceName
$DurationInSeconds = ($execution.RunDuration % 100) + [int]( ($execution.RunDuration % 10000 ) / 100 ) * 60 + [int]( ($execution.RunDuration % 1000000 ) / 10000 ) * 60 * 60
$DurationInSeconds = ($execution.RunDuration % 100) + [math]::floor( ($execution.RunDuration % 10000 ) / 100 ) * 60 + [math]::floor( ($execution.RunDuration % 1000000 ) / 10000 ) * 60 * 60
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name StartDate -value ([dbadatetime]$execution.RunDate)
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name EndDate -value ([dbadatetime]$execution.RunDate.AddSeconds($DurationInSeconds))
Add-Member -Force -InputObject $execution -MemberType NoteProperty -Name Duration -value ([prettytimespan](New-TimeSpan -Seconds $DurationInSeconds))
Expand Down Expand Up @@ -303,4 +303,4 @@ function Get-DbaAgentJobHistory {
}
}
}
}
}

0 comments on commit d71dd73

Please sign in to comment.