Without requiring a re-configuration of the security settings of Internet Explorer, the following command:
$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)
will silently install Google Chrome from official sources.
The following command will get the last commit message from the Subversion log and display it:
(svn log -l 1 http://server.tld/svn --xml | Out-String) -replace "`r?`n(?!`r?`n)" | Select-XML -XPath '//log/logentry/msg' | Select-Object -ExpandProperty node | Format-Table -HideTableHeaders | Out-String
where:
http://server.tld/svn
is the URL to the Subversion repository
The command first uses the svn
command (must have an SVN client installed) to retrieve the last commit log messages in XML format, chomps all newlines and slurps all lines into a single line, converts the result to an XML object, selects the msg
node by XPath, expands the node, filters out the powershell output table headers and finally converts the powershell object to a string.
powershell.exe Start-Process cmd.exe -Verb runAs