functions/Add-BlankConnector.ps1

<#
.SYNOPSIS
  
Create a blank tool connector of any type
  
.DESCRIPTION
Adds a single blank tool connector using the tool connector config API endpoints
  
.EXAMPLE
Add-Blank-Connector 1 Checkmarx "Checkmarx Connector 1"
 
Output (entry ID)
 
  
#>


Function Add-BlankConnector
{
    [cmdletbinding()]
    param(
        [Parameter(Mandatory=$true)]
        [Int32]$ProjectID,
        [Parameter(Mandatory=$true)]
        [string]$ToolName,
        [Parameter(Mandatory=$true)]
        [string]$NewConnectorName
    )
    
    $uri = $CDXSERVER + "/x/tool-connector-config/entries/" + $ProjectID

    $body = Convertto-Json @{
        tool = $ToolName
        name = $NewConnectorName
    }

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

    $CreateTool
}