controls/job-history-barchart.ps1
function New-JobHistoryBarChart { param($Script) if ($null -ne $Script) { $Jobs = Get-UAJob -Script $Script } else { $Jobs = Get-UAJob } $Data = @() $Stats = Get-UAStats $ScriptHistory = $Stats.ScriptJobDayHistory $ScriptHistory | ForEach-Object { # Todo - Extra Scripts being created , this breaks everytthing #$Script = Get-UAScript -Id $_.ScriptId $Data += @{ scriptid = $_.ScriptId.ToString() count = $_.Count } } New-UDPageHeader -Text ("Most Frequently Used Scripts") New-UDNivoChart -Bar -Data $Data -Keys 'count' -IndexBy 'scriptid' -Height 500 -Width 1000 -MarginTop 50 -MarginRight 130 -MarginBottom 50 -MarginLeft 60 -Padding 0.3 } |