I m still trying to get my script working. What i m trying to do is gathering few installed apps version number from a list of computers and output as below. The format of output must be this way.
.
I have my test script with a pc list working now, but all registry info actually are pulling from my local PC, not from remote PCs. I have tried working with psexe, PSRemoteRegistry module, but did not get any good result. I need some help to get it work with a list of remote PCs please.
$app32 = Get-ChildItem HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
$app64 = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
$appAll = $app32 + $app64
$AllComputers = @()
ForEach($CompName in (GC C:\work\000.txt)){
$Computer = [PSCustomObject]@{"PC Name"=$CompName}
$appAll |
ForEach-Object {Get-ItemProperty $_.pspath} |
Where-Object {
$_.Displayname -match 'adobe air' -or
$_.Displayname -match 'vbsedit' -or
$_.Displayname -match 'TNCremo' -or
$_.Displayname -match '3Dconnexion 3DxSoftware' -or
$_.Displayname -match '3Dconnexion 3DxWare (x64)' -or
$_.Displayname -match '7-Zip' -or
$_.Displayname -match 'Adobe Acrobat' -or
$_.Displayname -match 'Adobe Flash' -or
$_.Displayname -match 'Adobe Reader'
} |
Select-Object DisplayName,DisplayVersion |
Sort-Object DisplayName|
%{
Add-Member -InputObject $Computer -NotePropertyName $_.DisplayName -NotePropertyValue $_.DisplayVersion
}
$AllComputers+=$Computer
}
#Make sure first computer has properties for all possible software titles
$AllComputers|
%{
$_|GM -MemberType Properties|select -expand Name
}|
Select -Unique|
?{$_ -notin ($AllComputers[0]|gm -MemberType Properties|select -Expand Name)}|
%{
Add-Member -InputObject $AllComputers[0] -NotePropertyName $_ -NotePropertyValue ""
}
#Output to file
$AllComputers|Export-Csv c:\work\000.csv -NoTypeInformation