# encoding: ascii
# api: powershell
# title: Get-InstalledProgram
# 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: 1348
# x-archived: 2016-07-30T12:34:32
# x-published: 2010-09-28T20:18:00
#
# Microsoft, PGP, Intel, Corel, Adobe, ABBYY, Marvell, Hewlett-Packard.
#
function Get-InstalledProgram()
{
param (
[String[]]$Computer,
$User
)
#############################################################################################
if ($User -is [String]) {
	$Connection = Get-Credential -Credential $User
}
#############################################################################################
foreach ($Comp in $Computer){
	if ($Connection -eq $null){
		$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"
						} |
						select __SERVER,Name,Version,InstallDate
		$Install_soft
	}
	else {
		$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"
						} |
						select __SERVER,Name,Version,InstallDate
		$Install_soft
	}
}
#############################################################################################
}
