VMware Cloud Community
MariusRoma
Expert
Expert
Jump to solution

Editing notes inside annotations

I apologize for the very basic question, but none of the samples I found all around works for me.

I have a vSphere 5.5 infrastructure and I need to add a given line to the field "Notes" inside the "Annotations" in the VM summary.

Usually the field "Notes" contains one or more lines as in the following sample:

Test VM created by John Doe

Development

Do not remove before January 2018

I need to add one line as in the following sample:

Development Team

Test VM created by John Doe

Development

Do not remove before January 2018

How can I read the content of the "Notes" field and add a line?

The field "Notes" can be empty.

Regards

marius

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try something like this

$vm = Get-VM -Name MyVM

set-vm -VM $vm -Notes "Development Team`r$($vm.Notes)"


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try something like this

$vm = Get-VM -Name MyVM

set-vm -VM $vm -Notes "Development Team`r$($vm.Notes)"


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

Reply
0 Kudos
MariusRoma
Expert
Expert
Jump to solution

You are right, as usually.

Let me add:

set-vm -VM $vm -Notes "Development Team`r$($vm.Notes)" -Confirm:$false

Many thanks

marius

Reply
0 Kudos