- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I like the idea of having the descriptions in an secondary file to keep them simple, I'm not sure how to incorporate that into a functional script. I can dump the data into a csv file fairly easily - it would mean the csv file was more bloated than it needed to be but I'm wide open to suggestions!
On a side note, I changed a value on a VM tag and reran the script found an error (as expected).
..Creating Tag under Cost Center of 9999999
.... Assigning 9999999 in Category of Cost Center to tagtestvm1
New-TagAssignment : 10/17/2018 2:14:50 PM New-TagAssignment The tag with id 'InventoryServiceTag-83fa7d15-e5e9-48d9-b7b5-dbf27acb365b' cannot be assigned to entity with id 'VirtualMachine-vm-891'. The category of the specified
tag either does not support this entity type or only allows a single tag assignment per entity.
At line:30 char:4
+ New-TagAssignment -Entity $($_.Name) -Tag $tTag | Out-Null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Tag:String) [New-TagAssignment], ViError
+ FullyQualifiedErrorId : ViCore_TaggingServiceImpl_TagAssignment_InvalidTagAssociation,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.NewTagAssignment
Can you help with this? As the csv data may change and need to be applied again. I envision this script being part of a CMDB sync that we're trying to get running as things change the tags would update.