Skip to content

[Feature Request] Add paging support to list cmdlets (Get-SafeguardUser/Asset/AssetAccount/A2a) #644

Description

@DanPeterson

Summary

Add explicit paging (-Take / -Skip, or transparent auto-paging) to the collection getters so large directories can be pulled completely and efficiently. Grouping the affected cmdlets into one request since it is the same underlying ask:

  • Get-SafeguardUser
  • Get-SafeguardAsset
  • Get-SafeguardAssetAccount
  • Get-SafeguardA2a (also lacks -Fields today)

Motivation

These cmdlets support -Fields (except Get-SafeguardA2a) but do a single unpaged Invoke-SafeguardMethod ... GET under the hood. For large collections, callers who care about completeness and performance have to drop back to raw REST with take/skip:

Invoke-SafeguardMethod Core GET Users -Parameters @{ fields = 'Id,...'; take = $n; skip = $s }

Adding paging to the supported cmdlets removes the need for a hand-rolled paging helper and keeps -Fields usable at scale. For Get-SafeguardA2a, please also add -Fields for parity.

Proposed API

Get-SafeguardUser         [...] [-Fields <string[]>] [-Take <int>] [-Skip <int>]
Get-SafeguardAsset        [...] [-Fields <string[]>] [-Take <int>] [-Skip <int>]
Get-SafeguardAssetAccount [...] [-Fields <string[]>] [-Take <int>] [-Skip <int>]
Get-SafeguardA2a          [...] [-Fields <string[]>] [-Take <int>] [-Skip <int>]

Transparent auto-paging (the cmdlet loops internally until the server returns fewer than a page) would be even better and fully backward-compatible.

Current workaround

A custom paging wrapper around Invoke-SafeguardMethod that loops take/skip.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions