(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
它不会是一个巨大的交易在管道后过滤,但我试图找出我做错了什么在这里:)