首页 > 解决方案 > Get-ItemProperty HKLM...:为什么我找不到 Chrome?

问题描述

我在用着:

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, InstallLocation |
    Format-Table –AutoSize | clip

但我在其中找不到 Chrome,而我可以在 Windows 控制面板中找到它。为什么?

标签: powershell

解决方案


如果您运行的是 64 位系统,您还需要在 WOW6432Node 下进行搜索。也可以作为配置文件应用程序而不是系统应用程序在 CU 上下文中安装。

试试这个来捕捉一切:

$RegHives = "HKLM:\Software","HKLM:\Software\WOW6432Node","HKCU:\Software"
$Apps = @()

ForEach ($Hive in $RegHives)
{
    $Apps += Get-ItemProperty $Hive\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, InstallLocation
}


$Apps | Format-Table –AutoSize | clip

推荐阅读