sailpoint-oss / powershell-sdk

PowerShell Module for accessing SailPoint IdentityNow APIs
https://developer.sailpoint.com/
MIT License
21 stars 15 forks source link

Invoke-PaginateResults is breaking and not sending all the results back #7

Closed rob-buskens-sp closed 1 year ago

rob-buskens-sp commented 1 year ago

In PSSailpoint>1.0.2>Pagination.ps1>function invoke-PagnateSearch, looks like a bug.

image

if the $Result.length is less than the $Increment it's breaking. However there can be results. e.g. paging by 50, and there were 1 - 49 results. it's throwing those away by breaking out of the while loop without adding the remaining items.

I added the last result to the total results before the break and it now returns all results

        if($Result.Length -lt $Increment) {
            $Results += $Result
            break
        }

        $Results += $Result
        $InitialOffset += $Increment;
tyler-mairose-sp commented 1 year ago

Hello @rob-buskens-sp, good catch! This is fixed by https://github.com/sailpoint-oss/powershell-sdk/pull/10 and will be included in the next release!