public/service_desk/New-ServiceDeskTicket.ps1
Function New-ServiceDeskTicket { [cmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'low' )] param( [Parameter( Mandatory, Position = 0, ValueFromPipeline )] [ValidateNotNullOrEmpty()] [hashtable] $Body ) Begin { } Process { $Endpoint = '/api/service_desk/tickets' If ($PSCmdlet.ShouldProcess($Server, "POST $Endpoint")) { $newApiPOSTRequestSplat = @{ Body = $Body Endpoint = $Endpoint } $Result = New-ApiPOSTRequest @newApiPOSTRequestSplat } } End { $Result } } |