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