]> apps.delaporte.us Git - dotfiles.git/blob - psmodules/sprint.psm1
f925040a005bd6d5e4bd2486db3508caa139ec0c
[dotfiles.git] / psmodules / sprint.psm1
1
2 function Show-SprintPlan(){
3 param(
4 [switch]$list = $false,
5 [switch]$chart = $false
6 )
7 Write-Host "## Stats"
8 $closed = Get-GHClosed
9 $closed_count = ($closed | Measure-Object).Count
10 Add-Content -Path ~/.chart_closed -Value "|$closed_count"
11 $env:closed = Get-Content -Path ~/.chart_closed
12
13 $orphans = Get-GHNoMilestone -repository SecOps-Tools
14 $orphans_count = ($orphans | Measure-Object -Property updated_at -Min -Max).Count
15 Add-Content -Path ~/.chart_orphans -Value "|$orphans_count"
16 $env:orphans = Get-Content -Path ~/.chart_orphans
17
18 $unsized = Get-GHUnsized
19 $unsized_count = ($unsized | Measure-Object).Count
20 Add-Content -Path ~/.chart_unsized -Value "|$unsized_count"
21 $env:unsized = Get-Content -Path ~/.chart_unsized
22
23 if($chart) {
24 chart -var "closed"
25 }
26 Write-Host "Closed Issues this Sprint: $closed_count"
27 if($chart) {
28 chart -var "unsized"
29 }
30 Write-Host "Count of Unsized Issues: $unsized_count"
31 if($chart) {
32 chart -var "orphans"
33 }
34 Write-Host "Count of Issues with no milestone: $orphans_count"
35
36 if($list) {
37 Write-Host "## Closed Issues Updated this Sprint (Show-GHClosed)"
38 $closed | Show-GHIssuesAsMarkdown
39 Write-Host "## Unsized Issues (Show-GHUnsized)"
40 $unsized | Show-GHIssuesAsMarkdown
41 Write-Host "## Issues with No Milestone"
42 $orphans | Show-GHIssuesAsMarkdown
43 }
44
45 }
46 Export-ModuleMember -Function Show-SprintPlan