Automation

 View Only
  • 1.  Install vmtools 12 from ISO

    Posted May 27, 2022 02:56 PM

    Hello, I need to update vmtools version 11.360 to 12, but our ESXi 6.5 U3 cannot be updated yet, it will take time. So I have to go from ISO. To accomplish this I grabbed few lines from this post https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerShell-remoting-to-install-VMWare-tools/m-p/2257706 and tested locally, and it works. However, when inside Invoke-Command from remote it does not. These are the lines I'm using:

    $CDRom = Get-WmiObject -class Win32_CDROMDrive | Select-Object Drive | ForEach-Object { $_.Drive }
    $Subpath = '\setup64.exe'
    $EXE = Join-Path -Path $CDRom -ChildPath $Subpath
    Start-Process -FilePath $EXE -ArgumentList "/S /v /qn REBOOT=ReallySuppress"
     
    until line 3 I can confirm all good, then Start-Process does not do anything and generates no error at all. From Task Manager on remote server nothing happens. Any idea?


  • 2.  RE: Install vmtools 12 from ISO

    Posted May 27, 2022 03:55 PM

    How did you pass this to the Invoke-Command?
    Did you try using a transcript log (Start-Transcript)?



  • 3.  RE: Install vmtools 12 from ISO

    Posted May 27, 2022 06:31 PM

    Hi Luc,

    very simply like this:

    $block = {

        $CDRom = Get-WmiObject -class Win32_CDROMDrive | Select-Object Drive | ForEach-Object { $_.Drive }
        $Subpath = '\setup64.exe'
        $EXE = Join-Path -Path $CDRom -ChildPath $Subpath
        Start-Process -FilePath $EXE -ArgumentList "/S /v /qn REBOOT=ReallySuppress"

    }

    Invoke-Command -Session $Session -ScriptBlock $block



  • 4.  RE: Install vmtools 12 from ISO

    Posted May 27, 2022 06:37 PM

    Did you try to use a transcript file?



  • 5.  RE: Install vmtools 12 from ISO
    Best Answer

    Posted May 27, 2022 07:29 PM
        $CDRom = Get-WmiObject -class Win32_CDROMDrive | Select-Object Drive | ForEach-Object { $_.Drive } 
        $Subpath = '\setup64.exe' 
        $EXE = Join-Path -Path $CDRom -ChildPath $Subpath 
        $runEXE = $EXE + " " + "/S /v /qn REBOOT=ReallySuppress"
        cmd.exe /c $runEXE 

     

    no I didn't. Found the above to be working, not elegant but for now it'll do.