Private/Get-CtfConditionId.ps1

function Get-CtfConditionId {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory = $true)]
    [string]$Oracle,

    [Parameter(Mandatory = $true)]
    [string]$QuestionId,

    [Parameter(Mandatory = $true)]
    [int]$OutcomeSlotCount,

    [Parameter()]
    [ValidateSet('table', 'json')]
    [string]$Output = 'table'
  )

  process {
    $id = [Polymarket]::GetConditionId($Oracle, $QuestionId, $OutcomeSlotCount)
    if ($Output -eq 'json') {
      @{ condition_id = $id } | ConvertTo-Json | Write-Host
    } else {
      $id
    }
  }
}