Public/Get-GCScripts.ps1
|
<# .SYNOPSIS Retrieves a list of scripts. .DESCRIPTION Returns a paginated list of scripts from Genesys Cloud. Uses the GET /api/v2/scripts endpoint. .PARAMETER PageSize The number of results per page. Defaults to 25. .PARAMETER PageNumber The page number to retrieve. Defaults to 1. .PARAMETER Name Filter scripts by name. .EXAMPLE Get-GCScripts .EXAMPLE Get-GCScripts -Name 'Inbound*' .NOTES Genesys Cloud API: GET /api/v2/scripts #> function Get-GCScripts { [CmdletBinding()] param( [Parameter()] [int]$PageSize = 25, [Parameter()] [int]$PageNumber = 1, [Parameter()] [string]$Name ) $endpoint = "scripts" $queryParams = @{ pageSize = $PageSize pageNumber = $PageNumber } if ($Name) { $queryParams['name'] = $Name } return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams } |