diff --git a/tools/pax8.ps1 b/tools/pax8.ps1 index e2ca075..930b7da 100644 --- a/tools/pax8.ps1 +++ b/tools/pax8.ps1 @@ -79,6 +79,10 @@ function Invoke-Pax8Provision { Write-Host "[PAX8] Company provisioned successfully: $($response.id)" } catch { - throw "[PAX8] Company creation failed: $($_.Exception.Message)" + if ($_.Exception.Response -and $_.Exception.Response.StatusCode.Value__ -eq 422) { + Write-Host "[PAX8] A company with this information already exists." + } else { + throw "[PAX8] Company creation failed: $($_.Exception.Message)" + } } } \ No newline at end of file