From: Edward Delaporte Date: Wed, 7 Jul 2021 14:07:43 +0000 (-0500) Subject: List my GitHub issues. X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/495689b83456c790c1634d46d245fcd14fdba5e0?hp=-c List my GitHub issues. --- 495689b83456c790c1634d46d245fcd14fdba5e0 diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 00ba3b9..f70c705 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -100,23 +100,14 @@ function Get-GitStatus() { git status -b --short } -function Get-DashBoard() { - Measure-JournalTodos - chart - # todo - # Get-JournalAgenda - Write-Host "Todo items for today:" - Get-JournalTodayTodos - Write-Host "Use command 'todo' to list more tasks." - Write-Host "Use command 'agenda' to list the plan for today." -} - function Get-JournalAgenda() { Get-Content $(Get-JournalFile -date $(Get-Date)) } - +# Nice for git New-Alias ol Get-GitLog New-Alias st Get-GitStatus -New-Alias dash Get-Dashboard + +# Dashboard +New-Alias dash Get-MyDashboard # See dash.psm1 New-Alias agenda Get-JournalAgenda diff --git a/psmodules/dash.psm1 b/psmodules/dash.psm1 index 560f729..4b74daa 100644 --- a/psmodules/dash.psm1 +++ b/psmodules/dash.psm1 @@ -1,19 +1,16 @@ -function Get-MyDashboard() { - $MyDashboard = New-UDDashboard -Title "Hello, World" -Content { - New-UDCard -Title "Hello, Universal Dashboard" -Content { - New-UDParagraph -Text 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.' - } -Links @( - New-UDLink -Text 'This is a link' -Url '#!' - New-UDLink -Text 'This is a link' -Url '#!' - ) -Size 'small' - } - return $MyDashboard +function Get-MyDashBoard() { + Measure-JournalTodos + chart + # todo + # Get-JournalAgenda + Write-Host "Todo items for today:" + Get-JournalTodayTodos + Write-Host "GitHub Issues Assigned" + Show-GHMine + Write-Host "Use command 'todo' to list more tasks." + Write-Host "Use command 'agenda' to list the plan for today." } -function Inovke-MyDashboard() { - Start-UDDashboard -Port 1000 -Dashboard Get-MyDashboard - Write-Host "http://localhost:1000" -} -Export-ModuleMember -Function Invoke-MyDashboard \ No newline at end of file +Export-ModuleMember -Function Get-MyDashboard \ No newline at end of file diff --git a/psmodules/edgithub.psm1 b/psmodules/edgithub.psm1 index 0f26e24..a1f7c7a 100644 --- a/psmodules/edgithub.psm1 +++ b/psmodules/edgithub.psm1 @@ -39,5 +39,42 @@ function Show-GHClosed() { } +<# +.SYNPOSIS + +Fetch GitHub issues I am working on. + +#> +function Get-GHMine() { + param( + [int]$days = -14 + ) + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ Assignee = 'edthedev'; State = 'open'; OwnerName = 'techservicesillinois' } + $issues = @() + $repos | ForEach-Object { + $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + + return $issues +} + +<# +.SYNOPSIS + +Show GitHub issues I am working on. + +#> +function Show-GHMine() { + param( + ) + Get-GHMine | ForEach-Object { + # Markdown output + " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + } +} + + Export-ModuleMember -Function Get-GHClosed -Export-ModuleMember -Function Show-GHClosed \ No newline at end of file +Export-ModuleMember -Function Show-GHClosed +Export-ModuleMember -Function Show-GHMine \ No newline at end of file