Skip to content

Instantly share code, notes, and snippets.

@psycalc
Created September 12, 2016 20:58
Show Gist options
  • Save psycalc/b1ee86165efd4b41587f0c31b99578df to your computer and use it in GitHub Desktop.
Save psycalc/b1ee86165efd4b41587f0c31b99578df to your computer and use it in GitHub Desktop.
check github repo existance powershell
$a = git ls-remote --exit-code https://github.com/designofhumanity/$ProjectName 2>&1
if ($a.Exception)
# {
# $AnswerRepo =Read-Host -Prompt "Create repository on github? 1 - yes, 2 - no"
# If ($AnswerRepo -eq "1") {
# $result =Invoke-RestMethod -Headers $Headers -Uri https://api.github.com/user/repos -Body $Body -Method post | Format-Wide -Property clone_url -Column 1 | out-string
#..................................... and so on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment