1 Reply Latest reply on Feb 12, 2013 3:05 AM by jmedd

    Set-Annotation: The specified parameter 'CustomAttribute' expects a single value

    jmedd Enthusiast
    vExpert

      vCenter 4.1 U2

      PowerCLI 5.0 build 435427

       

      Create a custom attibute that applies to more than one type of object, e.g.

       

      New-CustomAttribute -Name 'TestAttribute' -TargetType VirtualMachine,Cluster

       

      Then attempt to set a value for an object of either of those types, e.g.

       

      Get-Cluster ClusterA | Set-Annotation -CustomAtrribute 'TestAttribute' -Value "True"

       

      or

       

      Get-VM VM_A | Set-Annotation -CustomAtrribute 'TestAttribute' -Value "True"

       

      both fail with

       

      Set-Annotation: The specified parameter 'CustomAttribute' expects a single value, but your name criteria 'TestAttribute' corresponds to multiple values

       

      If I create a custom attribute that applies to only one type of object, e.g.

       

      New-CustomAttribute -Name 'TestAttribute' -TargetType Cluster

       

      then the below works fine

       

      Get-Cluster ClusterA | Set-Annotation -CustomAtrribute 'TestAttribute' -Value "True"

       

      If I repeat the test with

       

      vCenter 4.1 U2

      PowerCLI 5.1 Release 1 build 793510

       

      then I am able to use Set-Annotation with custom attributes that have been applied to more than one TargetType.

       

      So it looks like it has been fixed in PowerCLI 5.1, but would like to confirm before recommending upgrading. Is anybody able to re-produce the issue on PowerCLI 5.0?