diff --git a/Public/New/New-HaloSalesOrder.ps1 b/Public/New/New-HaloSalesOrder.ps1 new file mode 100644 index 0000000..d02f33c --- /dev/null +++ b/Public/New/New-HaloSalesOrder.ps1 @@ -0,0 +1,25 @@ +Function New-HaloSalesOrder { + <# + .SYNOPSIS + Creates one or more sales orders via the Halo API. + .DESCRIPTION + Function to send a sales order creation request to the Halo API + .OUTPUTS + Outputs an object containing the response from the web request. + #> + [CmdletBinding( SupportsShouldProcess = $True )] + [OutputType([Object[]])] + Param ( + # Object or array of objects containing properties and values used to create one or more new quotations. + [Parameter( Mandatory = $True )] + [Object[]]$SalesOrder + ) + Invoke-HaloPreFlightCheck + try { + if ($PSCmdlet.ShouldProcess($SalesOrder -is [Array] ? 'SalesOrders' : 'SalesOrder', 'Create')) { + New-HaloPOSTRequest -Object $SalesOrder -Endpoint 'salesorder' + } + } catch { + New-HaloError -ErrorRecord $_ + } +} \ No newline at end of file