]> us-delaporte.pagekite.me Git - dotfiles.git/blob - psmodules/dash.psm1
Add --help to `Show-MyDashboard`
[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 <#
12
13 .SYNOPSIS
14
15 Show a text dashboard.
16
17 .EXAMPLE
18
19 Include `Todo` list.
20 Show-MyDashboard -todo
21
22 #>
23 function Show-MyDashBoard() {
24 param(
25 # [switch]$todocount=$true,
26 [switch]$agenda=$true,
27 [switch]$gitHub=$false,
28 [switch]$help,
29 [switch]$bugs=$false,
30 [switch]$todo=$false,
31 [switch]$pr=$false,
32 [switch]$requested=$false,
33 [switch]$orphans=$false
34 )
35 $todocount = $true
36 if($todocount){
37 Measure-JournalTodos
38 Write-Host ""
39 Write-Host "## Todo items for today: $env:todocount"
40 chart -var todocount
41 }
42 if($agenda){
43 Write-Host ""
44 Write-Host "## Agenda for today:"
45 Get-JournalAgenda
46 }
47 if($github) {
48 Write-Host ""
49 Write-Host "## GitHub Status (gh status)"
50 Invoke-Expression "gh status"
51 }
52 if($bugs) {
53 Write-Host ""
54 Write-Host "## Known Bugs"
55 Invoke-AgileCmd "gh issue list -S 'label:bug'"
56 }
57 if($todo) {
58 Write-Host ""
59 Write-Host "## Todo List"
60 todolist
61 }
62 if($requested){
63 Write-Host ""
64 Write-Host "## Open Stakeholder Requests"
65 invoke-agilecmd "gh issue list -S 'label:requested'"
66 }
67 if($pr) {
68 Write-Host ""
69 Write-Host "## Open Pull Requests"
70 Invoke-AgileCmd "gh pr list"
71 }
72 if($orphans) {
73 Write-Host ""
74 Write-Host "## Issues with No Milestone"
75 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
76 }
77 if($help) {
78 Write-Host "## Dasbhoard Help"
79 Get-Help Show-MyDashboard
80 }
81 }
82
83 function Show-MyTeamWork() {
84 $team = @('ddriddle', 'zcarrington', 'tzturner', 'mpitcel', 'edthedev')
85 $team | ForEach-Object {
86 "## $_ - Issues Assigned"
87 Get-AgileQuery -Assignee $_ | Invoke-AgileQuery | Show-MarkdownFromGitHub
88 }
89 }
90
91 Export-ModuleMember -Function Show-MyDashboard
92 Export-ModuleMember -Function Show-MyTeamWork