Skip to content

Instantly share code, notes, and snippets.

@rayterrill
Created April 27, 2018 04:18
Show Gist options
  • Select an option

  • Save rayterrill/3d31fc4a8b998804aad78fd85e61b809 to your computer and use it in GitHub Desktop.

Select an option

Save rayterrill/3d31fc4a8b998804aad78fd85e61b809 to your computer and use it in GitHub Desktop.
GetGithubReposViaAPI.ps1
$AuthString = '{0}:{1}' -f 'USERNAME','PASSWORD'
$AuthBytes = [System.Text.Encoding]::Ascii.GetBytes($AuthString)
$global:BasicCreds = [Convert]::ToBase64String($AuthBytes)
$content = invoke-webrequest https://api.github.com/orgs/PortofPortland/repos?type=All -Headers @{"Authorization"="Basic $BasicCreds"}
$content.Content | ConvertFrom-JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment