VMware Cloud Community
c01x04
Contributor
Contributor

PowerCLI 10 - Get-tag and get-tagassignment are not working as expected.

We use tags many reports and to allow users to manage information about VM's. We run a script that pulls this information into a spreadsheet.

Running

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

PS C\>get-tag computername*

get-tag : 05/03/2018 14:05:32   Get-Tag         Unexpected character encountered while parsing value: <. Path '', line 0

,

position 0..

At line:1 char:1

+ get-tag UK-D*

+ ~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-Tag], CisException

    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTag.Err

   or,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTag

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

PS C:\> $vms = get-vm | where {$_.powerstate -eq "PoweredOn"} | select -first 30

PS C:\> foreach ($vm in $vms) {get-tagassignment -Entity $vm }

get-tagassignment : 05/03/2018 14:07:15 Get-TagAssignment               Unexpected character encountered while parsing v

alue: <.

Path '', line 0, position 0..

At line:1 char:24

+ foreach ($vm in $vms) {get-tagassignment -Entity $vm }

+                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-TagAssignment], CisException

    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Impl.V1.Service.Tagging.Cis.TaggingServiceCisImpl.GetTagAssi

   gnment.Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.Tagging.GetTagAssignment

Any help would be great.

0 Kudos
1 Reply
Paul_Knight1
Contributor
Contributor

@LucD pointed me here.  Did you also open an SR on this problem? ​Re: Unstable Retrieval of Tag Assignments Introduced In 6.5?

0 Kudos