commands

^

ConvertTo-DbaTimeline

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

 

Synopsis

Converts InputObject to a html timeline using Google Chart

Description

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

Syntax

ConvertTo-DbaTimeline
    [-InputObject] <Object[]>
    [-ExcludeRowLabel]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

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 = "smtp.ad.local"
>> }
>>
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

-InputObject

Pipe input, must an output from the above functions.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-ExcludeRowLabel

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 visualisation. All relevant details are still available in the tooltip.

Alias
Required False
Pipeline false
Default Value False
-EnableException

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.

Alias
Required False
Pipeline false
Default Value False

 

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.