PoshCode Archive  Artifact [c70174f826]

Artifact c70174f8266a71a8474eba86e474fa8c355be0b36e8317b704cff08adc2a5130:

  • File Get-InstalledProgram_v3.ps1 — part of check-in [7462ad385c] at 2018-06-10 13:00:38 on branch trunk — Getting a list of installed programs on computers in the network except the following vendors: (user: Angel-Keeper size: 1858)

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