functions/Initialize-AnalysisPrep.ps1

<#
.SYNOPSIS
Prepares a project for analysis
  
.DESCRIPTION
Initializes a project within Code DX to begin an analysis. Returns a prepID
  
.EXAMPLE
Initialize-AnalysisPrep [project-id]
 
Output [prepID]
 
#>

Function Initialize-AnalysisPrep
{
    [cmdletbinding()]
    param(
        [Parameter(Mandatory=$true)]
        [string]$ProjectID
    )
    
    $uri = $CDXSERVER + "/api/analysis-prep"

    $body = @{
                projectId= $ProjectID
            } | ConvertTo-Json

    Write-Verbose $body

    $PrepInfo = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -ContentType "application/json" -Body $body
    
    Write-Verbose ( $PrepInfo | Format-Table | Out-String )

    return $PrepInfo
}