- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this. But if there is more than one VM with that name in vCenter, it will assign a tag to all VMs with that name.
$VmTag = Get-Tag "TagName"
Get-VM -Name $ChosenName | New-TagAssignment -Tag $VmTag