hebedich 通过本文主要向大家介绍了powershell wmi,powershell,windows powershell,powershell是什么,powershell下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
如果你想知道当前插在你电脑上的USB设备,WMI能帮助你:
Get-WmiObject -Class Win32_PnPEntity |
Where-Object { $_.DeviceID -like 'USBSTOR*' }
</div>
这将返回所有插上在使用的USBSTOR设备类
如果你使用WMI查询语言(WQL),你甚至可以使用筛选命令:
Get-WmiObject -Query 'Select * From Win32_PnPEntity where DeviceID Like "USBSTOR%"'</div>
本方法适合所有的powershell版本
</div>
