Hi Wyatt,

I now have a custom fact using powershell commands to get the installed 
software's for windows machines.

*PS Command:-* 
Get-ItemProperty 
HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | 
where{$_.DisplayName -and $_.displayname -notmatch 'Update'} | 
Select-Object DisplayName, DisplayVersion | ForEach-Object {Write-Host 
$_.DisplayName"="$_.DisplayVersion}

*Output:-*
ActiveState ActiveTcl 8.4.20.0 = 8.4.20.0
Microsoft .NET Framework 4 Client Profile = 4.0.30319
Microsoft .NET Framework 4 Extended = 4.0.30319
Notepad++ = 6.9.1
Microsoft .NET Framework 4 Extended = 4.0.30319
Puppet = 3.8.7
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 = 11.0.61030.0
Microsoft .NET Framework 4 Client Profile = 4.0.30319
MSXML 4.0 SP2 Parser and SDK = 4.20.9818.0
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17 = 9.0.30729
VC9.0 SP0 Debug CRT DLLs = 1.0.0
Microsoft Visual C++ 2012 x86 Additional Runtime - 11.0.61030 = 11.0.61030
Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.61030 = 11.0.61030
Microsoft Visual C++ 2010  x86 Redistributable - 10.0.40219 = 10.0.40219
ActivePerl 5.16.3 Build 1603 = 5.16.1603

Thanks,
Harish

On Thursday, May 19, 2016 at 1:11:17 AM UTC+5:30, Wyatt Alt wrote:
>
> Harish,
>
> The reason for that is the resources returned by puppet resource come from 
> the RAL, rather than PuppetDB. If you were to declare puppet resources with 
> the content included in your paste, then they would show up in PuppetDB. 
>
> PuppetDB will only include version information on package resources if the 
> package is managed by puppet and the version is specified in the resource 
> declaration. The most straightforward way to get information on all 
> packages installed (e.g not managed by Puppet) into PuppetDB is to create a 
> custom fact. I saw a module posted to the forge to do this the other day: 
> https://forge.puppet.com/rmueller/pkg_inventory
>
> Looks like it currently supports only redhat but if you're on something 
> else you should be able to get an idea of how to adapt it based on the fact 
> defined here: 
> https://github.com/roman-mueller/rmueller-pkg_inventory/blob/master/lib/facter/pkg_inventory.rb
>  
> .
>
> Given the fact you could get the data by querying 
> localhost:8080/v4/facts/packages, assuming the name of the fact is 
> "packages".
>
> Hope that helps.
>
> Wyatt
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b2d8ef64-438f-46da-8385-390378591198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to