1

我想从 Devcon.exe 输出中选择一个对象。

PCI\VEN_8086&DEV_2822&SUBSYS_1790103C&REV_04\3&11583659&0&FA
    Name: Intel(R) Chipset SATA/PCIe RST Premium Controller
Driver node #0:
    Inf file is C:\Windows\INF\iastorav.inf
    Inf section is iaStorAVC_inst
    Driver description is Intel Chipset SATA RAID Controller
    Manufacturer name is Intel Corporation
    Provider name is Intel Corporation
    Driver date is 2/7/2018
    Driver version is 15.44.0.1010
    Driver node rank is 16711683
    Driver node flags are 00102044
        Inf is digitally signed
Driver node #1:
    Inf file is C:\Windows\INF\oem9.inf
    Inf section is iaStorAC_inst_8
    Driver description is Intel(R) Chipset SATA/PCIe RST Premium Controller
    Manufacturer name is Intel Corporation
    Provider name is Intel Corporation
    Driver date is 5/9/2019
    Driver version is 17.5.0.1017
    Driver node rank is 8388611
    Driver node flags are 00003044
        Inf is digitally signed

我想Driver version通过映射来获得Driver description. 我试过这种方式,但我无法获得驱动程序版本。

 $hardwareid = "PCI\VEN_8086&DEV_2822&SUBSYS_1790103C&REV_04"
 $Description = "Intel(R) Chipset SATA/PCIe RST Premium Controller"
 $DrNode = & .\devcon.exe /drivernodes "$hardwareid"             
 $Ver = $DrNode | Where-Object {$_ -like "*$Description*"} | Select-Object Driver version

任何人都可以提供想法。非常感谢!

4

1 回答 1

2

问题是 devcon 输出文本。像这样使用 WMI 怎么样?

Get-WmiObject Win32_PnPSignedDriver | 
  where description -match 'apple solid state drive device' |
  select driverversion

driverversion
-------------
6.0.6400.0

好的,这在winpe中对我有用。我在这里得到它: https://superuser.com/questions/1438704/how-to-find-driver-version-for-all-devices-through-wmi/1438715#1438715 它从文件中获取驱动程序的版本信息。

get-wmiobject Win32_SystemDriver | select DisplayName,@{n="version";
  e={(get-item $_.pathname).VersionInfo.FileVersion}} | 
  where displayname -match 'apple solid state drive'

DisplayName                    version
-----------                    -------
Apple Solid State Drive Device 6.0.6400.0
于 2020-05-29T02:24:51.490 回答