Public/Get-MpThreatList.ps1

function Get-MpThreatList {
    <#
    .SYNOPSIS
        Gets a list of unique Windows Defender threats.
    .DESCRIPTION
        Returns a list of unique threats identified by Windows Defender with their IDs and names.
    .EXAMPLE
        Get-MpThreatList
    .OUTPUTS
        System.Object[]
    #>

    [CmdletBinding()]
    param()
    
    try {
        # Initialize the MP threats data
        $initResult = Initialize-MPThreats
        if (-not $initResult) {
            Write-Error "Failed to initialize threat data"
            return $null
        }
        
        # Return the unique threats list
        return $Script:mpthreats
    }
    catch {
        Write-Error "An error occurred while getting MP threat list: $_"
        return $null
    }
}