# encoding: ascii
# api: powershell
# title: Get-InstalledProgram_v3
# description: Getting a list of installed programs on computers in the network except the following vendors:
# version: 0.1
# type: function
# author: Angel-Keeper
# license: CC0
# function: Get-InstalledProgram
# x-poshcode-id: 1737
# x-archived: 2010-04-09T14:52:38
#
# Microsoft, PGP, Intel, Corel, Adobe, ABBYY, Marvell, Hewlett-Packard.
# P.S. Speed of performance of a script is improved
#
function Get-InstalledProgram() {
param (
[String[]]$Computer,
$User
)
#############################################################################################
if ($User) {$Connection = Get-Credential -Credential $User}
#############################################################################################
if (!$Connection){
	foreach ($Comp in $Computer){
		$Install_soft = gwmi win32_product -ComputerName $Comp | where {$_.vendor -notlike "*Microsoft*" -and $_.vendor -notlike "*PGP*" -and $_.vendor -notlike "*Intel*" -and $_.vendor -notlike "*Corel*" -and $_.vendor -notlike "*Adobe*" -and $_.vendor -notlike "*ABBYY*" -and $_.vendor -notlike "*Sun*" -and $_.vendor -ne "SAP" -and $_.vendor -ne "Marvell" -and $_.vendor -ne "Hewlett-Packard"} | Format-Table __SERVER,Name,Version,InstallDate
		$Install_soft
	}
}
else {
	foreach ($Comp in $Computer){	
		$Install_soft = gwmi win32_product -ComputerName $Comp -Credential $Connection | where {$_.vendor -notlike "*Microsoft*" -and $_.vendor -notlike "*PGP*" -and $_.vendor -notlike "*Intel*" -and $_.vendor -notlike "*Corel*" -and $_.vendor -notlike "*Adobe*" -and $_.vendor -notlike "*ABBYY*" -and $_.vendor -notlike "*Sun*" -and $_.vendor -ne "SAP" -and $_.vendor -ne "Marvell" -and $_.vendor -ne "Hewlett-Packard"} | Format-Table __SERVER,Name,Version,InstallDate
		$Install_soft
	}
}
}
