Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryancbutler/fe1d891d5ccd81bb56c90bb184061d7d to your computer and use it in GitHub Desktop.
Save ryancbutler/fe1d891d5ccd81bb56c90bb184061d7d to your computer and use it in GitHub Desktop.
$url = "http://192.168.2.250/vmwaretools/VMware%20Tools64-NOVMCHECk.msi"
$filename = "VMwareTools64-NOVMCHECk.msi"
#Update VM Tools
#$UnattendedArgs = '/S /v /qn REBOOT=R'
$filepath = "$($env:SystemRoot)\temp"
Invoke-WebRequest -Uri $url -OutFile "$filepath\$filename" -UseBasicParsing
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = '{0}-{1}.log' -f ("$filepath\$filename"),$DataStamp
$MSIArguments = @(
"/i"
('"{0}"' -f ("$filepath\$filename"))
"/qn REBOOT=R"
"/S"
"/v"
"/L*v"
$logFile
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -Passthru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment