This new version takes old features and builds on top of it. It now can send notifications to Microsoft Teams, Slack but it's a bit faster, especially on a higher amount of IPs to check. This version changes your CONFIGURATION file. If you use this module already, please check new version below.
To make sure you don't take my word for it I've actually spent some time and you can choose the way you want to use Search-Blacklist with. The newest version comes with parameter RunType which allows you to choose one of 6 parameters
While as you can imagine there's not much benefit to having all those choices… I wanted to verify the difference between Workflow, Runspaces and [Net.DNS] vs newer Resolve-DNS. You can find some results below:
Results of searching for 4 IPs on about 80 blacklists. As you can see below Runspaces are much faster to what is offered by Workflow and to what is available without it. What's a bit surprising is that [Net.DNS] is faster on Runspaces than Resolve-DNS at the same time losing heavily with Resolve-DNS when using Workflow. Of course, there may be some other conditions that play it, or maybe some small differences in implementation but it would seem Resolve-DNS is a bit slower than using Net.DNS but I still decided to use it due to modern functionality.
With just 1 IP the differences aren't as visible and are a bit different allowing Resolve-DNS to score few points more in comparison to Net.DNS. Of course, Runspaces win this one too. Actually, for Runspaces there seemed to be marginal change. In the end, it all doesn't matter. This tool is supposed to run in the background and doing this every 1 hour or so. Just in case you would like to test this out yourself be my guest. If you find inconsistencies in my testing, please let me know!
Clear-Host
Import-Module PSBlackListChecker -Force
$RunTypes = 'NoWorkflowAndRunSpaceNetDNS', 'NoWorkflowAndRunSpaceResolveDNS', 'WorkflowResolveDNS', 'WorkflowWithNetDNS', 'RunSpaceWithResolveDNS', 'RunSpaceWithNetDNS'
$IPs = '89.74.48.96' , '89.74.48.97', '89.74.48.98', '89.74.48.99'
$Results = @()
foreach ($RunType in $RunTypes) {
Write-Color '[', 'start ', ']', ' Testing ', $RunType -Color White, Green, White, White, Yellow
$StopWatch = [System.Diagnostics.Stopwatch]::StartNew()
$BlackList = Search-BlackList -IP $IPs -RunType $RunType -ReturnAll
$StopWatch.Stop()
$BlackListListed = $BlackList | Where-Object { $_.Islisted -eq $true }
$BlackListListed | Format-Table -AutoSize
Write-Color '[', 'output', ']', ' Blacklist Count ', $Blacklist.Count, ' Blacklist Listed Count ', $($BlackListListed.Count) -Color White, Yellow, White, White, Gray, White, Green
Write-Color '[', 'end ', ']', ' Elapsed ', $RunType, ' minutes: ', $StopWatch.Elapsed.Minutes, ' seconds: ', $StopWatch.Elapsed.Seconds, ' Milliseconds: ', $StopWatch.Elapsed.Milliseconds -Color White, Red, White, White, Yellow, White, Yellow, White, Green, White, Green, White, Green
$Results += [PsCustomObject][ordered]@{
'RunType' = $RunType
'BlackList All' = $Blacklist.Count
'BlackList Found' = $BlackListListed.Count
'Time Minutes' = $StopWatch.Elapsed.Minutes
'Time Seconds' = $StopWatch.Elapsed.Seconds
'Time Milliseconds' = $StopWatch.Elapsed.Milliseconds
}
}
$Results | Format-Table -Autosize