Skip to content

Centralize -Limit/-Sort/-Filter/-TotalOnly query-param handling in Invoke-PfbApiRequest #32

Description

Common read query params (-Limit, -Sort, -Filter, -TotalOnly, plus -Name/-Idnames/ids) are mapped by hand in every cmdlet body (if ($Sort) { $q['sort'] = $Sort } …). ConvertTo-PfbQueryString only stringifies an already-built hashtable — there is no helper mapping $PSBoundParameters → the query hashtable.

  • Add a shared helper (e.g. Add-PfbCommonQueryParams -BoundParameters $PSBoundParameters -Into $queryParams) encoding the standard name→key conventions
  • Centralize -TotalOnly count-return handling (already partly in Invoke-PfbApiRequest)
  • Document the convention so future cmdlets/generators use it

A user-facing parameter must still be declared in each cmdlet's param() block — this issue centralizes the behaviour/mapping, not the declarations (that sweep is the follow-up migration issue).

Per-parameter merit (roadmap): -Limit and -TotalOnly are load-bearing (auto-pagination means the pipeline cannot cap fetch); -Sort/-Filter are consistency-only. Consider landing the -Limit paginator fix in the same pass.

Blocked on: nothing.
Owner: Justin - fixed as PR #49

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions