Functions/EventSecurity/Remove-PASPTAIncludedTarget.ps1

# .ExternalHelp psPAS-help.xml
Function Remove-PASPTAIncludedTarget {
    [CmdletBinding(SupportsShouldProcess = $true)]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [string]$ID
    )

    BEGIN {
        Assert-VersionRequirement -RequiredVersion 14.0
    }#begin

    PROCESS {

        #Create request URL
        $URI = "$Script:BaseURI/api/pta/API/Administration/properties/CidrInclusionList/$ID"

        if ($PSCmdlet.ShouldProcess($ID, 'Delete PTA Included Monitored Target')) {

            #send request to web service
            Invoke-PASRestMethod -Uri $URI -Method DELETE -WebSession $Script:WebSession

        }

    }#process

    END { }#end

}