Hi Everyone,
I am trying to create a report of all the VMs within a VCenter. Using the get-vm with select-object and sort-object is a quite easy one liner. However I have custom notes fields. I realise I can expand these using the expandproperty, but am still unable to get both the vm "standard properties, such as name, vcpu, memory AND the extended notes fields.
What am I missing. Here is what I have, sans the extended fields . It more serves to explain what I am doing as "Install date" is actually a custom field.
get-vm | select-object "name","Install date" | sort-object "Powerstate"
Cheers
Stu
Hi Stu,
you can get the annotations with the Get-Annotation cmdlet. Like this:
Get-VM | ` Select-Object Name,@{N="Install date";E={($_|Get-Annotation -CustomAttribute "Install date").Value}} | ` Sort-Object Powerstate
Regards, Robert
Message was edited by: RvdNieuwendijk
Try that, it will do what you want, much eaiser than using a script.