PoshCode Archive  Artifact [bf22971e9e]

Artifact bf22971e9e954673e3877f344c3c5df75b8c1c32ddebaf718307dba63b77934c:

  • File Get-InstalledProgram.ps1 — part of check-in [8fb6325c4d] at 2018-06-10 12:56:55 on branch trunk — Getting a list of installed programs on computers in the network except the following vendors: (user: Angel-Keeper size: 1976)

# 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
	}
}
#############################################################################################
}