It’s Wednesday already, is that good or bad for you? Hoping it’s a good thing, and hoping todays one-liner makes it even better.
$Path = $env:TEMP; $Installer = 'chrome_installer.exe'; Invoke-WebRequest -Uri '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 $Path\$Installer
What this one-liner will do is go out and fetch chrome and silently install or update it. Then it will delete the installer after it has been installed. You could add lines for logging in case you had other software that you wanted to install after, but I feel this is a great foundation if you’ve never done it before. If you start adding logging and other features(ie. confirming it has installed), I’d definitely take it out of the one-liner format for ease of reading/troubleshooting unless for some reason you need to keep it as a one-liner.
You can do this with many applications, you just have to make sure the URI and switches(Args) are correct.