Author Marcin Gminski (@marcingminski)
Availability Windows, Linux, macOS


Want to see the source code for this command? Check out ConvertTo-DbaTimeline on GitHub.
Want to see the Bill Of Health for this command? Check out ConvertTo-DbaTimeline.


Converts InputObject to a html timeline using Google Chart


This function accepts input as pipeline from the following dbatools functions: Get-DbaAgentJobHistory Get-DbaDbBackupHistory (more to come...) And generates Bootstrap based, HTML file with Google Chart Timeline


    [-InputObject] <Object[]>




Example: 1
PS C:\> Get-DbaAgentJobHistory -SqlInstance sql-1 -StartDate '2018-08-13 00:00' -EndDate '2018-08-13 23:59' -ExcludeJobSteps | ConvertTo-DbaTimeline | Out-File C:\temp\DbaAgentJobHistory.html

-Encoding ASCII
Creates an output file containing a pretty timeline for all of the agent job history results for sql-1 the whole day of 2018-08-13

Example: 2
PS C:\> Get-DbaRegServer -SqlInstance sqlcm | Get-DbaDbBackupHistory -Since '2018-08-13 00:00' | ConvertTo-DbaTimeline | Out-File C:\temp\DbaBackupHistory.html -Encoding ASCII

Creates an output file containing a pretty timeline for the agent job history since 2018-08-13 for all of the registered servers on sqlcm

Example: 3
PS C:\> $messageParameters = @{
>> Subject = "Backup history for sql2017 and sql2016"
>> Body = Get-DbaDbBackupHistory -SqlInstance sql2017, sql2016 -Since '2018-08-13 00:00' | ConvertTo-DbaTimeline | Out-String
>> From = "[email protected]"
>> To = "[email protected]"
>> SmtpServer = ""
>> }
PS C:\> Send-MailMessage @messageParameters -BodyAsHtml

Sends an email to [email protected] with the results of Get-DbaDbBackupHistory. Note that viewing these reports may not be supported in all email clients.

Required Parameters


Pipe input, must an output from the above functions.

Required True
Pipeline true (ByValue)
Default Value

Optional Parameters


By default, the Timeline shows SqlInstance and item name (agent job or database) in row labels section of the chart. When this parameter (ExcludeRowLabel) is set to true the row labels will not be shown which will maximise the chart area for better visualization. All relevant details are still available in the tooltip.

Required False
Pipeline false
Default Value False

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Required False
Pipeline false
Default Value False