philips-software / powershell-cf-api

PowerShell module can deploy and teardown CloudFoundry spaces and services via a json definition file
MIT License
5 stars 6 forks source link

support for pagination with Invoke-GetRequest #14

Open lipkau opened 4 years ago

lipkau commented 4 years ago

I see the following problems with Invoke-GetRequest:

I have added pagination support to the Invoke-GetRequest. Note: No request apart from GET will respond with paginated results.

I also changed Invoke-GetRequest to return [PSCustomObject] instead of the json string. including the expansion of the resources :

            $responseBody = $response.Content | ConvertFrom-Json
            if (Get-Member -InputObject $responseBody -MemberType "*Property" -Name resources) {
                Write-Output $responseBody.resources
            } else {
                Write-Output $responseBody
            }

Let me know if you are interested in a PR for this.

marklindell commented 4 years ago

You are correct. I did not support pagination but welcome a PR.