Auftragspositionen.psm1
function Invoke-AuftragspositionStorno { param( [Parameter(Mandatory, ValueFromPipeline, Position = 0)] $AuftragspositionUid, [Parameter(Mandatory)] [int]$Menge, [Parameter()] [string]$Hinweis, [Parameter(Mandatory)] [string]$CommerceInstance ) process{ $Body = [PSCustomObject]@{ OrderItem = (ConvertTo-WeeduGuid $AuftragspositionUid); CanceledQuantity = $Menge; } if ($PSBoundParameters.ContainsKey("Hinweis")) { $Body | Add-Member -MemberType NoteProperty -Name "CancelNote" -Value $Hinweis; } Invoke-Weedu -Uri "commerce-{0}/rest/Orders/RegisterCancellation" -UriParams @($CommerceInstance) -Method POST -Body $Body; } } Export-ModuleMember -function Invoke-AuftragspositionStorno |