Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Public/New/New-HaloSalesOrder.ps1
Original file line number Diff line number Diff line change
@@ -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 $_
}
}