I have a hashtable ($applications) that looks like that:
Name Version ---- ------- Adobe Flash Player 19 ActiveX 19.0.0.226 Enterprise Library 4.0 - May 2008 4.0.0.0 Entity Framework Designer for Visual Studio 2012 - enu 11.1.21009.00 Fiddler 2.4.0.6 Google Chrome 49.0.2623.87 IIS 8.0 Express 8.0.1557
So I'm trying to exclude some applications from the list and for that I'm using:
[array]$excludeApps = "Fiddler","Chrome"
foreach ($excludeApp in $excludeApps){
$applications = $applications -notlike "*$excludeApp*"
}
The result maybe filtered out the exclude list but as not as I expected:
@{Name=Adobe Flash Player 19 ActiveX; Version=19.0.0.226}
@{Name=Enterprise Library 4.0 - May 2008; Version=4.0.0.0}
@{Name=Entity Framework Designer for Visual Studio 2012 - enu; Version=11.1.21009.00}
@{Name=IIS 8.0 Express; Version=8.0.1557}
I tried to handle those values with GetEnumerator() and several syntax of ${applications.Name} but nothing is worked. I believe that PowerShell detect this list as string.
Any idea how to handle this?