2

I am using Tags to filter VM / identify special configuration.

Get-VM -Tag TEST

Now I want to get all VMs NOT matching a tag .... Is there a way to do that without an extra loop to remove all items matching the Tag ?

4

2 に答える 2

2

どうやら、いいえ。しかし、別のループを使用することは悪い解決策ではありません。

次のようになります。

Get-VM -Name * | ?{$_.Tag -ne "Test"}

または、プロパティVirtualMachineがない場合は、次を試してください:TagGet-View

Get-View -Name * | ?{$_ .Tag -ne "Test"} | Get-VM
于 2014-01-11T05:47:59.560 に答える