VMware Cloud Community
jmedd
Enthusiast
Enthusiast

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

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?

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
Tags (1)
0 Kudos
1 Reply
jmedd
Enthusiast
Enthusiast

OK, the release notes for PowerCLI 5.1 Release 1 seem to indicate that this issue was fixed in that release:

Set-Annotation
Set-Annotation cannot set an annotation for a custom attribute if another custom attribute with the same name exists.

i.e. there are two custom attributes with the same name, just different TargetTypes.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos