Install Google Chrome from PowerShell

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.

Get Last Commit Message from Subversion Repository

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.

Open Elevated Command Prompt via UAC

powershell.exe Start-Process cmd.exe -Verb runAs

fuss/powershell.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.