Differences

This shows you the differences between two versions of the page.


Previous revision
Last revision
fuss:powershell [2018/07/26 16:08] office
Line 1: Line 1:
 +====== Install Google Chrome from PowerShell ======
 +
 +Without requiring a re-configuration of the security settings of Internet Explorer, the following command:
 +<code powershell>
 +$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)
 +</code>
 +
 +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:
 +<code powershell>
 +(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
 +</code>
 +where:
 +  * ''<nowiki>http://server.tld/svn</nowiki>'' 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 ======
 +
 +<code powershell>
 +powershell.exe Start-Process cmd.exe -Verb runAs
 +</code>
  

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.