powershell - Powershell中是否可以查询对象的属性页详细信息

标签 powershell

Powershell中是否可以查询对象“属性页面详细信息”以验证“版权”,“产品名称”和“文件版本”是否为空。寻找病毒时,我希望能够查询此信息

最佳答案

在PowerShell v2中,将FileVersionInfo附加到当您“dir”一个dll或exe时获得的对象,例如:

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)

像这样查询此信息:
gci c:\windows\*.exe | ? {$_.VersionInfo.LegalCopyright -notmatch 'Microsoft'} |
    fl VersionInfo

请注意,?是Where-Object cmdlet的别名。

关于powershell - Powershell中是否可以查询对象的属性页详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2851064/

相关文章:

powershell - Docker Run 命令挂起

powershell - 通过 PowerShell 发送电子邮件

powershell - 如何基于脚本参数(即msbuild、gradle)在powershell中实现任务

reflection - 如何在Powershell中创建新的ExeConfigurationFileMap实例?

powershell - 如何在PowerShell中仅列出用户创建的变量?

powershell - 您能区分 Windows 7 和 Windows Server 2008 R2 吗?

azure - 如何检查 Azure SQL 托管实例上的数据库还原花费了多长时间?

powershell - 通过 PowerShell + WinRM 传递双引号

windows - Powershell - 捕获套接字和进程

powershell - 使用Add-Member从数组创建对象