7 Replies Latest reply on May 15, 2019 12:26 AM by jvm2016

    adding _vmware tools_functinalities _powercli

    jvm2016 Hot Shot

      Hi Luc,

       

      Good morning

       

      I thought of adding vmware tools functinality  snippet to our main html script which we discussed yestaerday .

       

      i think we can add orange code to do so (this is what you provided few days back) .since it will update during next powercycle it wont cause any isueswith vm (or any network disconnection)??

       

      can you suggest on this??

       

       

      $vms_tools_upgrade_needed=$vms | Where-Object {$_.Guest.GuestFamily -eq 'windowsGuest' -and $_.ExtensionData.guest.toolsversionstatus -eq 'guesttoolsneedupgrade'}

       

      $do = New-Object -TypeName VMware.Vim.VirtualMachineConfigSpec

       

       

       

      $do.Tools = New-Object VMware.Vim.ToolsConfigInfo

       

       

       

      $do.Tools.ToolsUpgradePolicy = "UpgradeAtPowerCycle"

       

      Get-VM $vms_tools_upgrade_needed |

       

      ForEach-Object -Process {

      $_.ExtensionData.ReconfigVM_Task($do)

       

      }

       

       

       

       

      $fragments += $vms | Where-Object {$_.Guest.GuestFamily -eq 'windowsGuest' -and $_.ExtensionData.guest.toolsversionstatus -eq 'guesttoolsneedupgrade'}|

       

        select name|

       

         ConvertTo-Html -Property Name -Fragment -PreContent '<h2>WINDOWS_VM_TOOLS_NEED_UPGRADE</h2>' |

       

         Out-String