Automation

 View Only
  • 1.  Editing notes inside annotations

    Posted Nov 28, 2017 02:08 PM

    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



  • 2.  RE: Editing notes inside annotations
    Best Answer

    Posted Nov 28, 2017 02:13 PM

    Try something like this

    $vm = Get-VM -Name MyVM

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



  • 3.  RE: Editing notes inside annotations

    Posted Nov 29, 2017 04:41 PM

    You are right, as usually.

    Let me add:

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

    Many thanks

    marius