Skip to content

Instantly share code, notes, and snippets.

@zadjii-msft
Created May 18, 2023 16:33
Show Gist options
  • Save zadjii-msft/2ee3926811e83593c76fde17bb76073e to your computer and use it in GitHub Desktop.
Save zadjii-msft/2ee3926811e83593c76fde17bb76073e to your computer and use it in GitHub Desktop.
Make a graph of terminal PRs
$prs=Get-GitHubPullRequest -RepositoryName terminal -owner Microsoft -State closed
$wtprs=$prs | ? { $_.merged_at -ne $null -and $_.merged_at -gt ([datetime]"May 1, 2019") }
$wtprs | group { "{0}-{1}" -f ($_.created_at.year, $_.created_at.month) }
function was-microsoft($_) { $_.user.Login -In @("leonMSFT", "cinnamon-msft", "PankajBhojwani", "miniksa", "DHowett-MSFT", "carlos-zamora", "lhecker", "DHowett", "zadjii-msft") }
# Make a cool proportional graph of merged PRs
" COMM TEAM"; $wtprs | group { "{0}-{1:D2}" -f ($_.created_at.year, $_.created_at.month) } | % { $ms = ($_.Group | ? { was-microsoft $_ } | measure | select -expand Count); $tot=$_.Group | measure | select -expand count; $msv = [int](($ms/$tot)*15); $nmsv = 15-$msv; "`e[1m{0}`e[m `e[44m{1}`e[42m{2}`e[m" -f ($_.Name, (" " * [int]$nmsv), (" " * [int]$msv)) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment