Skip to content

Instantly share code, notes, and snippets.

@ryancbutler
Created September 15, 2018 12:09
Show Gist options
  • Select an option

  • Save ryancbutler/7f979e77713cfbb742bf39833f2e26f6 to your computer and use it in GitHub Desktop.

Select an option

Save ryancbutler/7f979e77713cfbb742bf39833f2e26f6 to your computer and use it in GitHub Desktop.
Write-Verbose "Starting VM Tools Installs" -Verbose
$UnattendedArgs = '/S /v /qn REBOOT=R'
$filepath = "$($env:SystemRoot)\temp\"
$url = "https://packages.vmware.com/tools/esx/latest/windows/x64/"
$link = invoke-webrequest $url -SessionVariable mysession
$link = $link.Links|Where-Object{$_.innerHTML -like "VMware*"}
$filename = ($link.href).Replace("x64/","")
Invoke-WebRequest -Uri ($url + $filename) -WebSession $mysession -OutFile "$filepath\$filename"
(Start-Process ("$filepath\$filename") $UnattendedArgs -Wait -Passthru).ExitCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment