Gabi
March 22, 2022, 6:24pm
1
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
tonyd
March 22, 2022, 6:35pm
2
Win32_Product is a bad idea. Google it.
This entry isn’t strictly related to Group Policy, but something I came across in that context a few days ago. There is a WMI class called Win32_Product. Querying this class lets you enumerate all installed MSI applications on a given system....
Est. reading time: 2 minutes
I think most folks query the registry for the info, at least that is what I do.
1 Like
Olaf
March 22, 2022, 8:10pm
3
Gabriel,
Welcome to the forum.
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
powershell
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?
tonyd
March 23, 2022, 5:55pm
7
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
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
}
})