controls/job-history-heatmap.ps1
function New-JobHistoryCalendar { param($Script) if ($null -ne $Script) { $Jobs = Get-UAJob -Script $Script } else { $Jobs = Get-UAJob } $Data = @() $Stats = Get-UAStats $JobHistory = $Stats.JobDayHistory $ScriptHistory = $Stats.ScriptJobDayHistory $JobHistory | ForEach-Object { $Data += @{ day = $_.JobDay.ToString("yyyy-MM-dd") value = $_.count } } $From = (Get-Date).AddDays(-30) $To = (Get-Date).AddDays(1) New-UDPageHeader -Text ("Job History Calendar") New-UDNivoChart -Calendar -Data $Data -From $From -To $To -Height 500 -Width 1000 -MarginTop 10 -MarginRight 130 -MarginBottom 10 -MarginLeft 60 } |