- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try something like this.
The variable $tagNames can contain 1 or more Tag names.
$tagNames = 'Tag1','Tag2','Tag3'
$vms = Get-VM -Tag $tagNames
$tagNames | ForEach-Object -Process {
$vms = Get-VM -Tag $_ | where{$vms.Name -contains $_.Name}
}
$vms
How you populate the variable $tagNames is up to you.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference