Finding ALL installed applications with PowerShell?

怎甘沉沦 提交于 2019-11-29 14:55:13

Well, sorry to do this again. I had a bad habit of answering my own questions.

Anyway, I found the answer to my question by searching the registry for "CruiseControl.NET". It seems that 64bit versions of windows store Uninstall information in multiple places. Most notably, uninstall information seems to be primarily aggregated at the following key:

HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\

I was able to find every program on my system listed here, including CruiseControl.NET. Note that this only seems to be the case on 64bit Windows Systems.

dugas

The below command finds CruiseControl.Net:

gci "HKLM:\software\Microsoft\windows\CurrentVersion\Uninstall" | %{ gp $_.PSPath } | where { $_.DisplayName -match "CruiseControl.NET" }

I can't honestly answer you about if the UninstallString is always present when searching the Uninstall Registry, nor can I tell you if you will find all applications installed on your machine. I know here MS gives instructions on a manual uninstall, which uses the UninstallString from this registry entry, so.. I am sure someone with more knowledge on the subject will comment..

Edit: Results on a Windows 7 Machine

PSPath            : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\Microsoft\windows\CurrentVersion\Uninstall\CruiseControl.NET
PSParentPath      : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\Microsoft\windows\CurrentVersion\Uninstall
PSChildName       : CruiseControl.NET
PSProvider        : Microsoft.PowerShell.Core\Registry
NSIS:StartMenuDir : CruiseControl.NET
CCNetVDir         : 1
DisplayName       : CruiseControl.NET 1.5.6804.1
UninstallString   : C:\Program Files\CruiseControl.NET\uninst.exe
DisplayIcon       : C:\Program Files\CruiseControl.NET\Server\ccnet.exe
DisplayVersion    : 1.5.6804.1
URLInfoAbout      : http://ccnet.thoughtworks.com/
Publisher         : ThoughtWorks
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!