$remove = @('microsoft*','visual*')
Get-WmiObject -Class Win32_Product -ComputerName $CompName | Where-Object {
$f = $_.name -notcontains $remove
$remove | Where-Object { $f.($_) }
} | Format-Wide -Property Name -Column 1
I'm not sure how to nest this properly so that I can filter out the everything in $remove
and display the rest of the programs. I'm not getting any errors it will wait for about 10 seconds then continue to the PS prompt.