]> apps.delaporte.us Git - dotfiles.git/blob - psmodules/dash.psm1
7e32ac4aa2487f28b83cddb1ca68b9b1f2489543
[dotfiles.git] / psmodules / dash.psm1
1 function Get-JournalAgenda() {
2 agenda.exe -path "$HOME/Journal/{YYYY}/{MM}-{DD}.md"
3 }
4
5 function Measure-JournalTodos() {
6 $todocount = todolist | Measure-Object -Line
7 $env:todocount += '|'
8 $env:todocount += $todocount.lines
9 }
10
11 function Show-MyDashBoard() {
12 param(
13 # [switch]$todocount=$true,
14 [switch]$agenda=$true,
15 [switch]$gitHub=$false,
16 [switch]$bugs=$false,
17 [switch]$todo=$false,
18 [switch]$pr=$false,
19 [switch]$orphans=$false
20 )
21 $todocount = $true
22 if($todocount){
23 Measure-JournalTodos
24 Write-Host ""
25 Write-Host "## Todo items for today: $env:todocount"
26 chart -var todocount
27 }
28 if($agenda){
29 Write-Host ""
30 Write-Host "## Agenda for today:"
31 Get-JournalAgenda
32 }
33 if($github) {
34 Write-Host ""
35 Write-Host "## GitHub Status (gh status)"
36 Invoke-Expression "gh status"
37 }
38 if($bugs) {
39 Write-Host ""
40 Write-Host "## Known Bugs"
41 Invoke-AgileCmd "gh issue list -S 'label:bug'"
42 }
43 if($todo) {
44 Write-Host ""
45 Write-Host "## Todo List"
46 todolist
47 }
48 if($pr) {
49 Write-Host ""
50 Write-Host "## Open Pull Requests"
51 Invoke-AgileCmd "gh pr list"
52 }
53 if($orphans) {
54 Write-Host ""
55 Write-Host "## Issues with No Milestone"
56 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
57 }
58 }
59
60 function Show-MyTeamWork() {
61 $team = @('ddriddle', 'zcarrington', 'tzturner', 'mpitcel', 'edthedev')
62 $team | ForEach-Object {
63 "## $_ - Issues Assigned"
64 Get-AgileQuery -Assignee $_ | Invoke-AgileQuery | Show-MarkdownFromGitHub
65 }
66 }
67
68 Export-ModuleMember -Function Show-MyDashboard
69 Export-ModuleMember -Function Show-MyTeamWork