Public/Remove-IAMCoreConnector.ps1

function Remove-IAMCoreConnector {
    [CmdletBinding(SupportsShouldProcess = $true)]
    param (
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
        [ValidatePattern("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")] # Is a guid connector object id
        [string]$Id
    )

    process {
        if ($PSCmdlet.ShouldProcess("Removing IAM Core connector $Id")) {
            $Result = Invoke-RestMethod -Uri "$Script:APIRoot/sync/connectors/$Id" -Headers (Get-IAMCoreHeader) -Method Delete

            if (!$Result.IsSuccess) {
                throw "Failed to remove IAM Core connector: $($Result.ErrorMessage)"
            }
        }
    }
}