functions/Invoke-AnalysisPrep.ps1

<#
.SYNOPSIS
Invoke a prepared analysis
  
.DESCRIPTION
Invokes Code Dx to begin processing a prepared analysis. This is called after "initialize-analysisprep" has been run and an analysis prep ID is available.
  
.EXAMPLE
Invoke-AnalysisPrep 1Hd3
 
Output [job_id]
 
#>


function Invoke-AnalysisPrep
{
    [cmdletbinding()]
    param(
        [Parameter(Mandatory=$true)]
        [string]$AnalysisPrepID
    )
    
    $AnalysisPrepID = $AnalysisPrepID.ToUpper()

    $uri = $CDXSERVER + "/api/analysis-prep/" + $AnalysisPrepID + "/analyze"

    $AnalysisJobInfo = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -ContentType "application/json" 

    Write-Verbose ( $AnalysisJobInfo | Format-Table | Out-String )

    return $AnalysisJobInfo
}