Created
May 31, 2019 10:33
-
-
Save chryzsh/bfb03620619e9148daf5d21ea5270336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Version = Invoke-WebRequest https://packages.vmware.com/tools/releases/latest/windows/x64/ -UseBasicParsing | Select-Object -ExpandProperty links | Select-Object href -ExpandProperty href | Select-String VM | |
$DownloadUrl="https://packages.vmware.com/tools/releases/latest/windows/x64/$Version" | |
$DownloadPath="C:\Windows\Temp\$Version" | |
Write-host "Downloading vmware tools from $DOwnloadUrl and saving to $DownloadPath" | |
Invoke-WebRequest -UseBasicParsing -Uri $DownloadUrl -OutFile $DownloadPath | |
#(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, $DownloadPath) | |
Write-host "Installing VMware Tools" | |
Start-Process -Wait $DownloadPath -ArgumentList '/S /V "/qn REBOOT=ReallySuppress"' -PassThru | |
Write-Host "Waiting for vmware tools to complete" | |
#Start-sleep -Seconds 120 | |
#if (Get-Process -Name VMwareToolsUpgrader) {Write-Host "Killing VMwareToolsUpgrader Process" | |
#Stop-Process -Name VMWareToolsUpgrader -Force -PassThru -Verbose} | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment