Get Software and name Desktop

Hello I would like to know how to have two columns software installed and name of the pc thank you very much for the time you gave me

$Path = “C:\Gabriel”
$LogPath = “C:\Gabriel”
Select Name,Directory,@{Name=“Outlook”;Expression={(Get-WmiObject -Class Win32_Product | where vendor -eq Outlook)}},
@{Name=‘Desktop’;Expression={(Get-wmiobject win32_computersystem)}} | Export-Csv C:\Gabriel\Outlook.csv -NoTypeInformation

Win32_Product is a bad idea. Google it.

I think most folks query the registry for the info, at least that is what I do.

1 Like

Gabriel,
Welcome to the forum. :wave:t4:

When you crosspost the same question at the same time to different forums you should at least post links to the other forums along with your question to avoid people willing to help you making their work twice or more.

Thanks

Regardless of that … When you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance

1 Like

Outlook may be installed as part of office so isn’t directly listed as an installed application,

here is a snippet from one of my scripts:-

    $apps=@(
        Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall|Get-ItemProperty
        Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall|Get-ItemProperty
    )

    $Applications=@(Foreach($app in $apps){
        [pscustomobject][Ordered]@{
            'DisplayName'                                          =     [String]$app.DisplayName
            'DisplayVersion'                                       =     [string]$app.DisplayVersion
            'InstallLocation'                                      =     [string]$app.InstallLocation
            'Publisher'                                            =     [string]$app.Publisher
            'EstimatedSize'                                        =     [string]$app.EstimatedSize
            'UninstallString'                                      =     [string]$app.UninstallString
            'RegistryKey'                                          =     [string]$app.PSPath
        }
    })

at the end $Applications will have a list of installed applications (as stored in add/remove programs)

My full script does a whole lot more

This won’t show everything that add/remove programs does, but it does usually show the majority

Would you mind elaborating please, what isn’t listed here? appx & appv I know about, is there more?

Along those lines Krazy Doug, how would you suggest getting the same list as Add/Remove without using Win32_Product?

I use basically the same approach listed here … then filter on unique values.

Thanks Krazy Doug :slight_smile:

This only looks for machine wide installs not per user (you know those annoying ones that go in %appdata% that most admin hate)

ok updated it to include current user

$apps=@(
        Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall|Get-ItemProperty
        Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall|Get-ItemProperty
        Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall|Get-ItemProperty
    )

    $Applications=@(Foreach($app in $apps){
        [pscustomobject][Ordered]@{
            'DisplayName'                                          =     [String]$app.DisplayName
            'DisplayVersion'                                       =     [string]$app.DisplayVersion
            'InstallLocation'                                      =     [string]$app.InstallLocation
            'Publisher'                                            =     [string]$app.Publisher
            'EstimatedSize'                                        =     [string]$app.EstimatedSize
            'UninstallString'                                      =     [string]$app.UninstallString
            'RegistryKey'                                          =     [string]$app.PSPath
        }
    })