在 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
您可以使用 Get-AppLockerFileInformation 获取 MSI 属性“ProductVersion”。仅当您的 MSI 经过数字签名时它才有效。
Get-AppLockerFileInformation -Path "C:\PathTo\my.msi" | Select -ExpandProperty Publisher | Select BinaryVersion