#1. Powershell的Filter过滤写法,本质为SQL写法
#F1
Get-WmiObject -Class Win32_Volume -Filter "Drivetype=3 and driveletter=null" | Select-Object BootVolume,FileSystem,DriveLetter,label|ft -a
#F2
$sql = "SELECT BlockSize,DriveLetter,Label,drivetype FROM Win32_Volume WHERE drivetype=3"
Get-WmiObject -Query $sql -ComputerName '.' | Select-Object DriveLetter,Label,BlockSize
##########################################################
值 含义
0 Unknown 未知
1 No Root Directory 无根目录
2 Removable Disk 可移动磁盘
3 Local Disk 本地磁盘
4 Network Drive 网络驱动器
5 Compact Disk 光盘
6 RAM Disk RAM盘