开发者

Is there a way in Powershell to query the object Property Page Details

Is there a way in Powershell to query the object Property Page Details to verify if the Copyright, Product name and File version are not empty. I want to be able to query this info when I'开发者_StackOverflow社区m looking for viruses


In PowerShell v2, the FileVersionInfo is attached to the object you get when you 'dir' a dll or exe e.g.:

PS\> Get-ChildItem C:\Windows\notepad.exe | Format-List VersionInfo


VersionInfo : File:             C:\Windows\notepad.exe
              InternalName:     Notepad
              OriginalFilename: NOTEPAD.EXE.MUI
              FileVersion:      6.1.7600.16385 (win7_rtm.090713-1255)
              FileDescription:  Notepad
              Product:          Microsoft® Windows® Operating System
              ProductVersion:   6.1.7600.16385
              Debug:            False
              Patched:          False
              PreRelease:       False
              PrivateBuild:     False
              SpecialBuild:     False
              Language:         English (United States)

Query this information like so:

gci c:\windows\*.exe | ? {$_.VersionInfo.LegalCopyright -notmatch 'Microsoft'} |
    fl VersionInfo

Note that ? is an alias for the Where-Object cmdlet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜