< Back
ConvertTo-DbaTimeline
Post
NAME ConvertTo-DbaTimeline
SYNOPSIS
Converts InputObject to a html timeline using Google Chart
SYNTAX
ConvertTo-DbaTimeline [-InputObject] <System.Object[]> [-ExcludeRowLabel <Switch>] [-EnableException <Switch>]
[<CommonParameters>]
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
PARAMETERS
-EnableException [<Switch>]
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
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ExcludeRowLabel [<Switch>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-InputObject [<System.Object[]>]
Pipe input, must an output from the above functions.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Tags: Chart
Author: Marcin Gminski (@marcingminski)
Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT
Dependency: ConvertTo-JsDate, Convert-DbaTimelineStatusColor
-------------------------- 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 = "dba@ad.local"
>> To = "dba@ad.local"
>> SmtpServer = "smtp.ad.local"
>> }
>>
PS C:\\> Send-MailMessage @messageParameters -BodyAsHtml
Sends an email to dba@ad.local with the results of Get-DbaDbBackupHistory. Note that viewing these reports may not
be supported in all email clients.
RELATED LINKS
https://dbatools.io/ConvertTo-DbaTimeline
SYNOPSIS
Converts InputObject to a html timeline using Google Chart
SYNTAX
ConvertTo-DbaTimeline [-InputObject] <System.Object[]> [-ExcludeRowLabel <Switch>] [-EnableException <Switch>]
[<CommonParameters>]
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
PARAMETERS
-EnableException [<Switch>]
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
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ExcludeRowLabel [<Switch>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-InputObject [<System.Object[]>]
Pipe input, must an output from the above functions.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Tags: Chart
Author: Marcin Gminski (@marcingminski)
Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT
Dependency: ConvertTo-JsDate, Convert-DbaTimelineStatusColor
-------------------------- 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 = "dba@ad.local"
>> To = "dba@ad.local"
>> SmtpServer = "smtp.ad.local"
>> }
>>
PS C:\\> Send-MailMessage @messageParameters -BodyAsHtml
Sends an email to dba@ad.local with the results of Get-DbaDbBackupHistory. Note that viewing these reports may not
be supported in all email clients.
RELATED LINKS
https://dbatools.io/ConvertTo-DbaTimeline