这有效:
Get-wmiobject -query "select * from CIM_datafile where name like '%.txt' and drive='e:'"
这不是:
Get-wmiobject -query "select * from CIM_datafile where name like '%.zip' and drive='e:'"
两者都使用WBEMtest:
select * from CIM_datafile where name like '%.zip' and drive='e:'
select * from CIM_datafile where name like '%.txt' and drive='e:'
有谁知道为什么会这样?有人有工作吗?我想搜索一些文件扩展名而不必使用gci。