(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec |
This comment has been minimized.
This comment has been minimized.
this doesn't work. Shouldn't the "c:/temp/chrome.exe" be "c:\temp\chrome.exe"? |
This comment has been minimized.
This comment has been minimized.
With a few changes, this works, worked on Win2012 and Win2012R2. It can be used all in one line: $LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound) |
This comment has been minimized.
This comment has been minimized.
Cool @yaxzone. Your command works. |
This comment has been minimized.
This comment has been minimized.
I love you guys almost as much as I hate Internet Explorer protected mode on Windows Server. That's a LOT |
This comment has been minimized.
This comment has been minimized.
Hats off to you guys! thanks for that script. |
This comment has been minimized.
This comment has been minimized.
@yaxzone thank you. |
This comment has been minimized.
This comment has been minimized.
@yaxzone works for windows server 2012 |
This comment has been minimized.
This comment has been minimized.
LOL, thanks guys! |
This comment has been minimized.
This comment has been minimized.
Thanks guys, found this quite useful for installing chrome on 30+ machines in Azure! If I may, I would suggest some small changes to make it a bit simpler and more readable. Firstly I would use the Invoke-WebRequest cmdlet to download the file, instead of creating a web client object and then download it, and instead of a Do-Until-loop I would use Start-Process with the -Wait switch, it will wait until the installer is done and continue instead of checking it with a loop and then continue. Secondly it is good practice to use the full command names instead of aliases, it makes it easier to read and understand for a novice and remove the risk of an alias to be removed so that the script fails (https://daniel.haxx.se/blog/2016/08/19/removing-the-powershell-curl-alias/). $Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer Thanks again :) |
This comment has been minimized.
This comment has been minimized.
this is neat |
This comment has been minimized.
This comment has been minimized.
Thanks @nicolaigj! |
This comment has been minimized.
This comment has been minimized.
Big Thanks!!! |
This comment has been minimized.
This comment has been minimized.
nice script, thanks a lot! Helped me on Azure as well!! |
This comment has been minimized.
This comment has been minimized.
nice script ,help me on server 1709! |
This comment has been minimized.
This comment has been minimized.
fabulous. was pulling my hair out trying to use ie11 on my aws EC2 instance XD |
This comment has been minimized.
This comment has been minimized.
neat thanks.. |
This comment has been minimized.
This comment has been minimized.
Thanks @yaxzone for your script. It worked very well...!! |
This comment has been minimized.
This comment has been minimized.
Thaaaank youuu |
This comment has been minimized.
This comment has been minimized.
Thanks @nicolaigj ! |
This comment has been minimized.
This comment has been minimized.
This is awesome! Helps the deployment day on 30+ servers |
This comment has been minimized.
This comment has been minimized.
Nice! Thanks both @yaxzone and @nicolaigj |
This comment has been minimized.
This comment has been minimized.
Why are you not using https? Why are you not using latest? https://dl.google.com/chrome/install/latest/chrome_installer.exe |
This comment has been minimized.
This comment has been minimized.
@XuTenghao Can you start up Chrome on the Windows server 1709? I use as a buildserver and wanted to run Selenium tests, but the chrome.exe fails with a pretty generic "ERROR:main_dll_loader_win.cc(134)] Failed to load Chrome DLL" Are you getting that, or can you log on to the server and do a chrome.exe --headless ? |
This comment has been minimized.
This comment has been minimized.
@Larswa I had the same problem. |
This comment has been minimized.
This comment has been minimized.
You can use this: $Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer; Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path$Installer |
This comment has been minimized.
This comment has been minimized.
after installing ,how we can bring up chrome in server 1709 |
This comment has been minimized.
This comment has been minimized.
It should be on your desktop. |
This comment has been minimized.
This comment has been minimized.
Here's a version of @redramos's command that can work from the Run dialog (considering its length limits): |
This comment has been minimized.
This comment has been minimized.
Neat commands y'all. But it installs 32 bit Chrome on 64 bit Windows. Anyone found a always latest version URL for Chrome 64 bit? |
This comment has been minimized.
This comment has been minimized.
@o-l-a-v Using this code, it downloads the online installer, and the 64-bit version is downloaded and installed: |
This comment has been minimized.
This comment has been minimized.
@STiG-1 |
This comment has been minimized.
This comment has been minimized.
I don't have access to internet on my windows server. How can I use this script then? |
This comment has been minimized.
This comment has been minimized.
You need to download the offline installer for Chrome. Store it on some internal file share and copy down during install or add it into the image, etc |
This comment has been minimized.
This comment has been minimized.
For something a little more sophisticated, here is a powershell function you can run. it also uses the latest version, not a specific version. i also used -PassThru to get the explicit process i started.
|
This comment has been minimized.
This comment has been minimized.
thank you so much. This solution works like a charm. Is there a way by which i can extract the chrome version from "http://dl.google.com/chrome/install/latest/chrome_installer.exe" |
This comment has been minimized.
This comment has been minimized.
If you get an error like |
This comment has been minimized.
this is pretty slick. Not super keen on the internet dependency, but if the internet was available, this is a pretty cool like line of code here...
Knotz