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
  • Delivered
  • Attach files
  • Kamen Nikolov commented
    April 19, 2023 13:23

    After a server side fix that was required the cmdlets are no longer case-sensitive when using PowerCLI 13.1 and vSphere 8.0

  • Brian Alexander commented
    June 16, 2022 12:06

    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
    January 24, 2018 13:51

    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
    January 05, 2018 23:16

    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
    January 05, 2018 23:15

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

  • Steve Kaplan commented
    January 05, 2018 22:10

    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
    January 05, 2018 22:09

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