Public/Get-GCWfmBusinessUnits.ps1

<#
.SYNOPSIS
    Retrieves a list of workforce management business units from Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve a paginated list of business units
    used in workforce management operations.
    API Endpoint: GET /api/v2/workforcemanagement/businessunits

.PARAMETER PageSize
    The number of results per page. Default is 25.

.PARAMETER PageNumber
    The page number to retrieve. Default is 1.

.EXAMPLE
    Get-GCWfmBusinessUnits
    Retrieves the first page of business units with default page size.

.EXAMPLE
    Get-GCWfmBusinessUnits -PageSize 50 -PageNumber 2
    Retrieves the second page of business units with 50 results per page.

.NOTES
    Genesys Cloud API: GET /api/v2/workforcemanagement/businessunits
#>

function Get-GCWfmBusinessUnits {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $false)]
        [int]$PageSize = 25,

        [Parameter(Mandatory = $false)]
        [int]$PageNumber = 1
    )

    $queryParams = @{
        pageSize   = $PageSize
        pageNumber = $PageNumber
    }

    $endpoint = "workforcemanagement/businessunits"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}