我想用Powershell获取Windows系统的所有驱动器号,但我无法弄清楚。 任何想法?Powershell获取所有光驱信件
我曾尝试使用Get-Volume
,但它有-ByDriveType
或-ByType
或-Type
或任何没有参数。
我想用Powershell获取Windows系统的所有驱动器号,但我无法弄清楚。 任何想法?Powershell获取所有光驱信件
我曾尝试使用Get-Volume
,但它有-ByDriveType
或-ByType
或-Type
或任何没有参数。
别名如果你只想要光驱(如在标题中提到的),使用此:
Get-CimInstance Win32_LogicalDisk | ?{ $_.DriveType -eq 5} | select DeviceID
这个给了我我需要的东西! – user3383458
这可能是有用的:http://superuser.com/questions/787613/viewing-all-accessible-drives-in-powershell – xmojmr