Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Filtering Software Vendors

$
0
0

I have a script that collects data from workstations like computer type, printers, software, etc.

I am trying to filter out specific vendors from the software section but it does not seem to be working.  Here is the code and any ideas?

Write-Host "Gathering Installed Software"
foreach ($app in (Get-WmiObject -Class win32_Product -ComputerName $computerName))
{
 if ($app.Vendor -notmatch "Google", "Oracle*", "Microsoft*", "Citrix*", "Adobe*")
 $row = $softwareTable.NewRow()
 $row["ComputerName"] = $computerName
 $row["ApplicationName"] = $app.Name
 $row["ApplicationVendor"] = $app.Vendor
 $row["ApplicationVersion"] = $app.Version
 $row["ApplicationInstallDate"] = $app.InstallDate
 $row["ApplicationInstallPath"] = $app.InstallSource
 $softwareTable.Rows.Add($row)
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles