(PS 版本 1)
PS C:\> $query = 'Select * From Exchange_PublicFolder WHERE Path LIKE "/Foo%"'
PS C:\> $query
Select * From Exchange_PublicFolder WHERE Path LIKE "/Foo%"
PS C:\> gwmi -namespace ROOT\MicrosoftExchangev2 -query $query
Get-WmiObject : Provider is not capable of the attempted operation
At line:1 char:5
+ gwmi <<<< -namespace ROOT\MicrosoftExchangev2 -query $query
如果我尝试先将查询分配给变量,这没有区别。WQL 关键字 WHERE 可能有问题吗?我可以在没有它的情况下运行查询:
PS C:\> (gwmi -namespace ROOT\MicrosoftExchangev2 -query "Select * From Exchange_PublicFolder").count
711
稍后在管道中过滤并不是什么大不了的事,但我试图找出我在这里做错了什么:)