Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Last active March 30, 2018 22:12
Show Gist options
  • Save IlyaFinkelshteyn/09476306eb506ac0bbf7036864e0d1e6 to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/09476306eb506ac0bbf7036864e0d1e6 to your computer and use it in GitHub Desktop.
$token = "<replace>"
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$orgs = Invoke-RestMethod -Uri "https://api.github.com/user/orgs" -Headers $headers -Method GET
$orgs | % {(Invoke-RestMethod -Uri "https://api.github.com/orgs/$($_.login)/teams" -Headers $headers -Method GET).name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment