批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程
[批处理文件精品]批处理版照片整理器[批处理文件精品]纯批处理备份&还原驱动在线第三方下载
返回列表 发帖

[转载代码] [PowerShell每日技巧]查看USB设备使用历史信息(20140327)

Did you know that Windows logs any USB stick type you ever used? To get that information from the Registry, simply use this function:
  1. function Get-USBInfo
  2. {
  3.   param
  4.   (
  5.     $FriendlyName = '*'
  6.   )
  7.   Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\*\' |
  8.   Where-Object { $_.FriendlyName } |
  9.   Where-Object { $_.FriendlyName -like $FriendlyName } |
  10.   Select-Object -Property FriendlyName, Mfg |
  11.   Sort-Object -Property FriendlyName
  12. }
复制代码
You can query for specific manufacturers, too:
  1. Get-USBInfo -FriendlyName *king*
复制代码
http://powershell.com/cs/blogs/tips/archive/2014/03/27/finding-usb-stick-information.aspx

返回列表