Scripts/New-UDTimeLineData.ps1

<#
.SYNOPSIS
    Sample control for UniversalDashboard.
.DESCRIPTION
    Sample control function for UniversalDashboard. This function must have an ID and return a hash table.
.PARAMETER Id
    An id for the component default value will be generated by new-guid.
.EXAMPLE
    PS C:\> <example usage>
    Explanation of what the example does
.INPUTS
    Inputs (if any)
.OUTPUTS
    Output (if any)
.NOTES
    General notes
#>

function New-UDTimeLineData {
    param(
        [Parameter(Mandatory = $true)]
        [string]$RowLabel,

        [Parameter(Mandatory = $false)]
        $BarLabel = "",

        [Parameter(Mandatory = $false)]
        $tooltip = $null,

        [Parameter(Mandatory = $true)]
        [DateTime]$Start,

        [Parameter(Mandatory = $true)]
        [DateTime]$End,

        [Parameter(Mandatory = $false)]
        $Color
    )

    End {
        [PSCustomObject]@{
            RowLabel = $RowLabel
            BarLabel = $BarLabel
            tooltip  = $tooltip
            Start    = "Date($($Start.Year), $($Start.Month - 1), $($Start.Day), $($Start.Hour), $($Start.Minute), $($Start.Second), $($Start.Millisecond))"
            End      = "Date($($End.Year), $($End.Month - 1), $($End.Day), $($End.Hour), $($End.Minute), $($End.Second), $($End.Millisecond))"
            Color    = $Color
        }

    }
}