Want to Increase Tag Performance on article https://blogs.vmware.com/performance/2019/06/writing-performant-tagging-code-tips-and-tricks-for-pow...
Does not get example 9B: Tagging Service
How do I get all VM attached tags via Tagging Service?
The parameter property names are case-sensitive I'm afraid.
So 'id' instead of 'Id' and 'type' instead of 'Type'
Try like this
$vm = Get-VM -Name $vmName
$allTagAssociationMethodSVC = Get-CisService com.vmware.cis.tagging.tag_association
$vmid = New-Object PSObject -Property @{
id = $vm.ExtensionData.MoRef.Value
type = $vm.ExtensionData.MoRef.Type
}
$allTagAssociationMethodSVC.list_attached_tags($vmid)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The parameter property names are case-sensitive I'm afraid.
So 'id' instead of 'Id' and 'type' instead of 'Type'
Try like this
$vm = Get-VM -Name $vmName
$allTagAssociationMethodSVC = Get-CisService com.vmware.cis.tagging.tag_association
$vmid = New-Object PSObject -Property @{
id = $vm.ExtensionData.MoRef.Value
type = $vm.ExtensionData.MoRef.Type
}
$allTagAssociationMethodSVC.list_attached_tags($vmid)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference