如果你想知道當(dāng)前插在你電腦上的USB設(shè)備,WMI能幫助你:
Get-WmiObject -Class Win32_PnPEntity | Where-Object { $_.DeviceID -like 'USBSTOR*' }
這將返回所有插上在使用的USBSTOR設(shè)備類
如果你使用WMI查詢語(yǔ)言(WQL),你甚至可以使用篩選命令:
Get-WmiObject -Query 'Select * From Win32_PnPEntity where DeviceID Like "USBSTOR%"'
本方法適合所有的powershell版本
新聞熱點(diǎn)
疑難解答
圖片精選