VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Tags and TagCategories in VCSA are case-sensitive, to test if a tag already exists you have to know the exact case. Please add an option to the tagging cmdlets to make it behavior case-insensitive.

  • Guest
  • Jan 5 2018
  • Planned
  • Attach files
  • Brian Alexander commented
    16 Jun 12:06pm

    I know this has been here a while but I just encountered it with PowerCLI 12.6.0 and vCenter 7.0u3c. Get-Tag is case-sensitive but New-Tag is not. I have some automation that synchronizes tags between the asset manager DB and vCenter. I came across this issue when checking for tags and creating them if they don't already exist. i.e. There is an existing tag named "TEST" in vCenter. I come across a tag named "Test" in the DB. Get-Tag -Category "Purpose" -Name "Test" finds nothing so I do a New-Tag -Category "Purpose" -Name "Test" which fails because the tag already exists. It's that inconsistency that is frustrating. Get-Tag -Category "Purpose" -Name "[T]est" does work as a work-around, so thanks for that, but it shouldn't be necessary.

  • Guest commented
    24 Jan, 2018 01:51pm

    Hi Marcel,

    The bug is logged internally. 

    In the meantime - a workaround is to use some wildcard characters in the -Name parameter of Get-Tag. This will force the filtering to be done client-side which is case-insensitive. For example: you can just put one of the characters of the name in square brackets (square brackets indicate a range of characters so the new filter will be equivalent to the one without brackets):

    Get-Tag -Name "[T]agName"

     

    Regards,

    Angel

  • Kyle Ruddy commented
    5 Jan, 2018 11:16pm

    Adding to Steve's comments, we found out that there is a vCenter version dependency with this issue. vCenter 6.5 is the one experiencing the issue, vCenter 6.0 behaves as expected. 

  • Kyle Ruddy commented
    5 Jan, 2018 11:15pm

    Marcel, thanks for the heads up. I have filed a bug to get this issue resolved. 

  • Steve Kaplan commented
    5 Jan, 2018 10:10pm

    Secondary question, how are you doing this checking? I specifically went and used the -Name parameter on both Get-Tag and Get-TagCategory... and both returned regardless of case on the string.

  • Steve Kaplan commented
    5 Jan, 2018 10:09pm

    What version of PowerCLI are you using? I just tested with 6.5.4, and it definitely is not case sensitive.