Skip to content

Instantly share code, notes, and snippets.

@fqjony
Last active November 15, 2022 13:55
Show Gist options
  • Select an option

  • Save fqjony/1293d1bd63e975d6627cd892e3a37d12 to your computer and use it in GitHub Desktop.

Select an option

Save fqjony/1293d1bd63e975d6627cd892e3a37d12 to your computer and use it in GitHub Desktop.
$FilePath = "C:\Windows\Temp\WindowsAzureVmAgent.msi"
Retry-WebRequest -Params @{
Uri='https://github.com/Azure/WindowsVMAgent/releases/download/2.7.41491.1071/WindowsAzureVmAgent.amd64_2.7.41491.1071_2209271071.fre.msi';
OutFile = $FilePath
}
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = '{0}-{1}.log' -f $FilePath,$DataStamp
$MSIArguments = @(
"/i"
('"{0}"' -f $FilePath)
"/qn"
"/norestart"
"/L*v"
$logFile
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment