如何使用 Powershell 获取 MSI 属性:版本值(在 MECM 的检测方法规则中找到)?

问题描述 投票:0回答:1

在 MECM 中,当我设置检测规则并浏览到 MSI 文件时,它不仅会导入产品代码,还会导入 MSI 版本号。

使用

(Get-Item $msiPath).VersionInfo | fl
,输出如下,我如何模仿MECM正在做的事情来找到下图所示的1.0.0000属性值?

OriginalFilename  : 
FileDescription   : 
ProductName       : 
Comments          : 
CompanyName       : 
FileName          : filenameandpath.msi
FileVersion       : 
ProductVersion    : 
IsDebug           : False
IsPatched         : False
IsPreRelease      : False
IsPrivateBuild    : False
IsSpecialBuild    : False
Language          : 
LegalCopyright    : 
LegalTrademarks   : 
PrivateBuild      : 
SpecialBuild      : 
FileVersionRaw    : 0.0.0.0
ProductVersionRaw : 0.0.0.0

enter image description here

powershell windows-installer sccm
1个回答
0
投票

您可以使用 Get-AppLockerFileInformation 获取 MSI 属性“ProductVersion”。仅当您的 MSI 经过数字签名时它才有效。

Get-AppLockerFileInformation -Path "C:\PathTo\my.msi" | Select -ExpandProperty Publisher | Select BinaryVersion
© www.soinside.com 2019 - 2024. All rights reserved.