Created
September 15, 2018 12:09
-
-
Save ryancbutler/7f979e77713cfbb742bf39833f2e26f6 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
| 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