Skip to content

Commit

Permalink
Update New-GitHubRepo.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 12, 2025
1 parent ec47a15 commit 785e3cc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Modules/CippExtensions/Public/GitHub/New-GitHubRepo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ function New-GitHubRepo {
}

# Check if repo exists
$Existing = Invoke-GitHubApiRequest -Path "$Path/$Name" -ErrorAction SilentlyContinue
if ($Existing.id) {
return $Existing
}

try {
$Existing = Invoke-GitHubApiRequest -Path "$Path/$Name"
if ($Existing.id) {
return $Existing
}
} catch { }
if ($PSCmdlet.ShouldProcess("Create repository '$Name'")) {
return (Invoke-GitHubApiRequest -Path $Path -Method POST -Body $Body)
}
Expand Down

0 comments on commit 785e3cc

Please sign in to comment.