Public/Contacts/Remove-Pax8ContactById.ps1

function Remove-Pax8ContactById {
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')]
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
    param (
        [Parameter(Mandatory)]
        [ValidateScript({
                try {
                    [System.Guid]::Parse($_) | Out-Null; $true
                } catch {
                    $PSCmdlet.ThrowTerminatingError($_)
                }
            })]
        [string]$companyId,
        
        [Parameter(Mandatory)]
        [ValidateScript({
                try {
                    [System.Guid]::Parse($_) | Out-Null; $true
                } catch {
                    $PSCmdlet.ThrowTerminatingError($_)
                }
            })]
        [string]$contactId
    )
    
    $endPoint = "companies/$($companyId)/contacts/$($contactId)"
    Invoke-Pax8RemoveRequest -Arguments $PSBoundParameters -EndPoint $endPoint
}