【问题标题】:Get guid of a program installed with an exe file获取使用 exe 文件安装的程序的 guid
【发布时间】:2017-03-09 09:36:25
【问题描述】:

我想知道如何查找和选择未在

中列出的程序的 guid
gcim win32_product

我希望能够选择名称和产品 id/guid,然后将它们用于第二部分。到目前为止我所拥有的:

Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty 

该 guid 已多次列出,但我现在不知道如何“抓取”或从括号中选择它

【问题讨论】:

标签: powershell guid dsc


【解决方案1】:

我能够弄清楚,它有点粗糙,但它显示了我需要的信息。

function Get-Guid
{
Param(
[parameter(Mandatory=$true)]
[string]$Name
)
$path = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
Get-ItemProperty -Path $path | Where-Object {$_.DisplayName -like "*$name*"} | select Displayname, ModifyPath
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-05
    相关资源
    最近更新 更多