Invoke-WebRequest in a loop until NotFound
You appear to have some incorrect logic. The until expression will never get evaluated in the case of a 404 exception. It will get skipped over. So it's kind of pointless.

So let's replace the repeat ... until with a while ($true). That is, an infinite loop. This works the same as what you already had, but the logic is clearer. I added a comment at the top, too, to let the reader know that a 404 exception will break the loop:

while ($true) {
    # Will throw 404 exception when finished.

    $Path = "/universes?offset=$offset&amp;limit=$limit"

    $response = Invoke-WebRequest "$baseUrl$Path" -Headers $headers 
    ($response | ConvertFrom-Json).universes.universe

    $offset += $limit
}


Now, in general it's not good to use exceptions for normal program control flow. They should normally be used for exceptional cases only. But sometimes—such as in this case it would seem—we do have to use them. In such cases the usual pattern is to catch the exception and then examine it to see if it's a normal control flow exception or if it's a true exception, and respond accordingly.

So let's do that. If we catch a 404 exception, then we will just ignore it. If it's anything else, then we will rethrow it:

try {
    while ($true) {
        # Will throw 404 exception when finished.

        $Path = "/universes?offset=$offset&amp;limit=$limit"

        $response = Invoke-WebRequest "$baseUrl$Path" -Headers $headers 
        ($response | ConvertFrom-Json).universes.universe

        $offset += $limit
    }
}
catch [System.Net.WebException] {
    $statusCode = $_.Exception.Response.StatusCode.Value__

    if ($statusCode -eq 404) {
        # Normal end case. Do nothing.
    }
    else {
        throw
    }
}