Hi,
I am unable to get tags info from the below command, Tags information is not clear. please help
Get-VM |
Select-object Name, @{N = 'vCenter'; E = {([system.uri]$_.ExtensionData.Client.ServiceUrl).Host}},
@{N='TagCategories';E={
$script:assigned = Get-TagAssignment -Entity $_
$script:assigned.Tag.Category.Name -join '|' }},
@{N='Tags'; E = {$script:assigned.Name -join '|'}} | ft -auto
Output
Name | vCenter | TagCategories | Tags |
---- | ------- | ------------- | ---- |
HADOOP02 | demovcenter Department|Owner|Application com.vmware.cis.tagging.TagAssociationModel|com.vmware.cis.tagging.TagAssociationModel|com.vmware.cis.tagging.TagAssociationModel | ||
HADOOP01 | demovcenter Department|Application | com.vmware.cis.tagging.TagAssociationModel|com.vmware.cis.tagging.TagAssociationModel |
That property is Tag.Name
Select-Object Name, @{N = 'vCenter'; E = {([system.uri]$_.ExtensionData.Client.ServiceUrl).Host}},
@{N='TagCategories';E={
$script:assigned = Get-TagAssignment -Entity $_
$script:assigned.Tag.Category.Name -join '|' }},
@{N='Tags'; E = {$script:assigned.Tag.Name -join '|'}} | ft -auto
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That property is Tag.Name
Select-Object Name, @{N = 'vCenter'; E = {([system.uri]$_.ExtensionData.Client.ServiceUrl).Host}},
@{N='TagCategories';E={
$script:assigned = Get-TagAssignment -Entity $_
$script:assigned.Tag.Category.Name -join '|' }},
@{N='Tags'; E = {$script:assigned.Tag.Name -join '|'}} | ft -auto
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you very much LucD. That worked perfectly