PowerShell 技能连载 - 查找已知的 USB 驱动器

您知道吗?Windows 维护着一个关于所有插入过您机器中的 USB 存储设备列表。要导出这个列表十分简单:

$Path = 'HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\*'
Get-ItemProperty -Path $Path |
  Select-Object -Property FriendlyName, CompatibleIDs, Mfg

结果看起来如下:

FriendlyName                                CompatibleIDs                              Mfg
------------                                -------------                              ---
SCANNER USB Device                          {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Android UMS Composite USB Device            {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Android UMS Composite USB Device            {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Generic Flash Disk USB Device               {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Hitachi HTS545050B9A300 USB Device          {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Landi A015 USB Device                       {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Landi A015 USB Device                       {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Landi A015 USB Device                       {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Linux File-CD Gadget USB Device             {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Linux File-CD Gadget USB Device             {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Linux File-CD Gadget USB Device             {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Linux File-CD Gadget USB Device             {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Multiple Card  Reader USB Device            {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
SAMSUNG GT-I9000 USB Device                 {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
SAMSUNG GT-I9000 Card USB Device            {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
SAMSUNG GT-I9000 Card USB Device            {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
Ut165 USB Flash Disk USB Device             {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...
WD Elements 1042 USB Device                 {USBSTOR\Disk, USBSTOR\RAW, GenDisk}       @disk.inf,%genmanufacturer%;(Standard d...

列表越长,说明您的计算机插入过越多种不同的 USB 存储设备。

PowerShell 技能连载 - 查找已知的 USB 驱动器

http://blog.vichamp.com/2013/12/05/finding-known-usb-drives/

作者

吴波

发布于

2013-12-05

更新于

2022-07-06

许可协议

评论