public/service_desk/Get-ServiceDeskQueue.ps1
Function Get-ServiceDeskQueue { [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( [Parameter( Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName )] [Alias('QueueId')] [int] $Id, [Parameter()] [ValidatePattern("^\?")] [string] $QueryParameters ) Begin { } Process { $Endpoint = "/api/service_desk/queues" If ($Id) { $Endpoint = "/api/service_desk/queues/{0}" -f $Id } If ($PSCmdlet.ShouldProcess($Server, "GET $Endpoint")) { $newApiGETRequestSplat = @{ QueryParameters = $QueryParameters Endpoint = $Endpoint } $Result = New-ApiGETRequest @newApiGETRequestSplat } } End { $Result.Queues } } |