Powershell get-item VersionInfo.ProductVersion incorrect / different than WMI

让人想犯罪 __ 提交于 2019-12-04 08:52:24

The problem is that you are using the ProductVersion propertie which seems to be hard coded somewhere, IE and WMI are just buildind the product version from :

ProductMajorPart   : 6
ProductMinorPart   : 1
ProductBuildPart   : 7601
ProductPrivatePart : 17767

Same for FileVersion with : FileMajorPart, FileMinorPart, FileBuildPart, FilePrivatePart

Just try :

(get-item C:\windows\system32\rdpcorekmts.dll).VersionInfo | fl *

You can test :

(get-item C:\windows\system32\rdpcorekmts.dll).VersionInfo | % {("{0}.{1}.{2}.{3}" -f $_.ProductMajorPart,$_.ProductMinorPart,$_.ProductBuildPart,$_.ProductPrivatePart)}

From CMD.EXE you can try :

C:\>powershell -command "&{(get-item C:\windows\system32\rdpcorekmts.dll).VersionInfo | % {write-host ('{0}.{1}.{2}.{3}' -f $_.ProductMajorPart,$_.ProductMinorPart,$_.ProductBuildPart,$_.ProductPrivatePart)}}"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!