TheJumpCloud / jcapi-powershell

MIT License
10 stars 3 forks source link

CUT-4040: Limit Param for DI Functions #75

Closed gweinjc closed 4 months ago

gweinjc commented 4 months ago

Issues

What does this solve?

The limit and skip params are being stripped in the DirectoryInsights module in favor of auto-pagination for results. With the reintroduction of the limit param, this will allow for manually setting limits which will save time in fetching results and will also allow for more precise filtering. If no limit param is specified, the function will automatically auto-paginate as it did previously

Is there anything particularly tricky?

NA

How should this be tested?

  1. Run Get-JcSdkEvent -Service:('all') -StartTime:((Get-date).AddDays(-7)) -Limit 1 -Sort:("DESC")
  2. Validate that it will error stating there is no parameter Limit
  3. Run (Get-JcSdkEvent -Service:('all') -StartTime:((Get-date).AddDays(-7)) -Sort:("DESC")).Count
  4. Validate that events results are returned
  5. Import the local DI psd1
  6. Run Get-JcSdkEvent -Service:('all') -StartTime:((Get-date).AddDays(-30)) -Limit 1 -Sort:("DESC")
  7. Validate that only 1 event is returned
  8. Run (Get-JcSdkEvent -Service:('all') -StartTime:((Get-date).AddDays(-7)) -Sort:("DESC")).Count
  9. Validate that the same result count is returned as step 3

    Screenshots