Skip to content

Instantly share code, notes, and snippets.

@ursenzler
Created April 8, 2014 06:58
Show Gist options
  • Save ursenzler/10098372 to your computer and use it in GitHub Desktop.
Save ursenzler/10098372 to your computer and use it in GitHub Desktop.
executes a command on all Appccelerate repos
function ExecuteOnRepos([string]$reposPath, [string]$command, [string]$arguments)
{
$folders = Get-ChildItem $reposPath | ?{ $_.PSIsContainer } | Select-Object FullName
foreach($folder in $folders)
{
cd $folder.FullName
$gitFolder = $folder.FullName + "\.git"
if (Test-Path $gitFolder)
{
write-host executing $command $arguments in $folder.FullName
& $command $arguments
}
else
{
write-host skipping because folder $folder.FullName is no git repository
}
cd ..
""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment