I'm working on building a whitelist comparison. It works perfectly, but I'd like to add the ability to have strings containing wildcards or regex included in the array representing the whitelist.
Comparing the other way around - with wildcards in the installed_software variable is easy enough, but I'm not sure how to tackle comparing an array of strings that may or may not be regular expressions. Do I need to iterate against each element in the whitelist and do a regex comparison? That sounds time intense.
$xxxxx | foreach-object {
$installed_software = $_
# Compare the installed application against the whitelist
if ( -not $whitelist.Contains( $installed_software ) )
{
$whitelist_builder += "$installed_software"
}