2021-06-07 10:23:22 +03:00
|
|
|
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise.msi';
|
2021-06-02 09:16:55 +03:00
|
|
|
|
|
|
|
if ([Environment]::Is64BitProcess) {
|
2021-06-07 10:23:22 +03:00
|
|
|
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'
|
2021-06-02 09:16:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$wc = New-Object net.webclient
|
|
|
|
$msiInstaller = "$env:temp\google-chrome.msi"
|
2021-06-07 10:23:22 +03:00
|
|
|
Write-Host "Downloading Google Chrome"
|
2021-06-02 09:16:55 +03:00
|
|
|
$wc.Downloadfile($url, $msiInstaller)
|
|
|
|
|
2021-06-07 10:23:22 +03:00
|
|
|
Write-Host "Installing Google Chrome"
|
2021-06-02 09:16:55 +03:00
|
|
|
$arguments = "/i `"$msiInstaller`" /quiet"
|
|
|
|
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
2021-06-07 10:23:22 +03:00
|
|
|
Remove-Item $msiInstaller
|
|
|
|
|
|
|
|
|
|
|
|
$suffix = "\\Google\\Chrome\\Application\\chrome.exe"
|
|
|
|
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
|
|
|
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
|
|
|
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
|
|
|
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
|
|
|
} else {
|
|
|
|
write-host "ERROR: failed to install Google Chrome"
|
|
|
|
exit 1
|
|
|
|
}
|