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
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
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
You are right, as usually.
Let me add:
set-vm -VM $vm -Notes "Development Team`r$($vm.Notes)" -Confirm:$false
Many thanks
marius