Public/Complete-TMTask.ps1

Function Complete-TMTask {
    param(
        [Parameter(Mandatory = $false)][pscustomobject]$ActionRequest,
        [Parameter(Mandatory = $false)][pscustomobject]$Data,
        [Parameter(Mandatory = $false)][Boolean]$AllowInsecureSSL = $false
    )

    if ($Data) {
        $DataOption = @{ Data = $Data }
    }

    ## Post Back Success with Data and Messages as provided by the Script
    Set-TMTaskAction -ActionRequest $ActionRequest -Progress 100 -State 'success' @DataOption -AllowInsecureSSL $AllowInsecureSSL
}