Public/Remove-SIAConnector.ps1

# .ExternalHelp IdentityCommand.SIA-help.xml
function Remove-SIAConnector {
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Justification = 'False Positive')]
    [CmdletBinding(SupportsShouldProcess)]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [Alias('id')]
        [String]$connector_id,

        [parameter(
            Mandatory = $false,
            ValueFromPipelinebyPropertyName = $true
        )]
        [switch]$force_delete
    )

    begin { }#begin

    process {

        $URI = "$($ISPSSSession.tenant_url)/api/connectors/$connector_id"

        if ($force_delete.IsPresent) {
            $URI = "$URI`?force_delete=true"
        }

        if ($PSCmdlet.ShouldProcess($connector_id, 'Delete SIA Connector')) {

            #Send Request
            $result = Invoke-IDRestMethod -Uri $URI -Method DELETE

            if ($null -ne $result) {

                $result

            }

        }

    }#process

    end { }#end

}