Created
December 21, 2011 17:17
-
-
Save deevus/1506832 to your computer and use it in GitHub Desktop.
Powershell script to pull and update all Mercurial repositories in the host directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cls | |
Write-Host "Searching for repositories to update..." | |
Write-Host | |
$dirs = Get-ChildItem | where {$_.PsIsContainer} | where { Get-ChildItem $_ -filter ".hg" } | |
foreach ($dir in $dirs) | |
{ | |
Start-Job -Name HgUpdate$dir -ArgumentList @($dir.FullName) -ScriptBlock { | |
pushd $args[0] | |
hg pull --update | |
} | Out-Null | |
"Created job for repository: " + $dir | |
} | |
Cls | |
Write-Host "Waiting for jobs to complete..." | |
Wait-Job HgUpdate* | Out-Null | |
Cls | |
Receive-Job HgUpdate* | |
Write-Host | |
Write-Host "All jobs completed." | |
Write-Host "Press any key to continue..." | |
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment