Powershell中是否有查询对象属性页详细信息的方法
是否可以在Powershell中查询对象属性页详细信息,以验证版权、产品名称和文件版本是否为空。当我在PowerShell v2中查找病毒时,我希望能够查询此信息,文件版本信息将附加到“dir”dll或exe时获得的对象,例如:Powershell中是否有查询对象属性页详细信息的方法,powershell,Powershell,是否可以在Powershell中查询对象属性页详细信息,以验证版权、产品名称和文件版本是否为空。当我在PowerShell v2中查找病毒时,我希望能够查询此信息,文件版本信息将附加到“dir”dll或exe时获得的对象,例如: PS\> Get-ChildItem C:\Windows\notepad.exe | Format-List VersionInfo VersionInfo : File: C:\Windows\notepad.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的别名。什么的属性页?(即什么样的“对象”?)