Hi all,
I just started with powercli.
I want to set and get the value of the notes field.
Setting it, is done by, Set-VM -VM "VM Name" -Description "text1 text2 etc." -Confirm:$false
But how to get the value of the notes field? I though that it could be done like: Get-VM -Name "VM Name" | Get-Annotation -CustomAttribute Description
However i get an error:
Get-Annotation : 07-08-2012 11:11:28 Get-Annotation Could not find Cu
regard kim
You can get the VM notes field with:
Get-VM | Select-Object -Property Name,Description
You can get the VM notes field with:
Get-VM | Select-Object -Property Name,Description
Thanks for fast reply
Robert van den Nieuwendijk wrote:
You can get the VM notes field with:
Get-VM | Select-Object -Property Name,Description
My PowerCLI says 'Description' is obsolete and you should use 'Notes' instead
That is correct, see also the reference page for the VirtualMachine object.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You are right. I must have a blind spot in my eyes for yellow warning messages.
Hi nanodk,
you can also check this out http://psvmware.wordpress.com/?s=annota
if you need to do more stuff with notes/description/annotations
I hope that can help as well in future
"
But how to get the value of the notes field? I though that it could be done like: Get-VM -Name "VM Name" | Get-Annotation -CustomAttribute Description
"
It failes because description/notes is not a custom attribute, but a normal primary attribute. In the link above you can find out more about custom attributes.
Regards,
Greg
You should be able to do Get-VM <vmname optional> | Select-Object Name,Notes
-Brad