VMware Cloud Community
thattommyhall2
Contributor
Contributor
Jump to solution

Get-Annotation not accepting pipeline input?

Syntax

Get-Annotation -CustomAttribute <CustomAttribute> -Entity <InventoryItem>

I would expect:

(1)

Get-VM | Get-Annotation -CustomAttribute Creator

and

(2)

Get-VM | % {Get-Annotation -CustomAttribute Creator -Entity $_}

to do the same thing but I get only one machine on (1)

AnnotatedEntityId Name Value

VirtualMachine-vm-140 Creator

and for (2) get:

AnnotatedEntityId Name Value

VirtualMachine-vm-140 Creator

VirtualMachine-vm-15844 Creator

VirtualMachine-vm-15834 Creator

etc

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Which PowerCLI version are you using ?

Get-PowerCLIVersion

In PowerCLI 4.1 option (1) works for me

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Which PowerCLI version are you using ?

Get-PowerCLIVersion

In PowerCLI 4.1 option (1) works for me

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
thattommyhall2
Contributor
Contributor
Jump to solution

mmmm, the version on vCenter is different to my machine

vCenter: 4.0 U1 build 208462

My desktop. 4.1 build 264274

And vCenter is at 4.1 now.

Schoolboy error but thanks!

Tom

0 Kudos