Launch non-blocking process from powershell

I’m writing a powershell script that needs to push code to several git repositories simultaneously?

Here’s the script I have thus far:


pushd $repoPath
$remoteRepos | % { 
    #Want to exexcute this without blocking
    & git push $_ master --fore -v 

Here’s how I execute the script:

gitdeploy.ps1 -repoPath c:\code\myrepo -remoteRepos repo1,repo2

How to I execute the & git push $_ master --fore -v in a way that is non-blocking?


Thanks to @Jamey for the solution. I wound executing this command:

Start-Process "cmd.exe" "/c git push $_ master --force -v"

  • Maintainig very own vendor with composer and git Symfony2 Bundle
  • Using Git as Bridge Between Git and SVN Repos?
  • How do you merge a commit that has been reverted?
  • PS1 line with git current branch and colors
  • How to use Git for Unity3D source control?
  • Adding a folder from an Eclipse project to Git source control
  • 2 Solutions collect form web for “Launch non-blocking process from powershell”

    You can also use start-process to run each push in an additional command window.

    start-process -FilePath "git" -ArgumentList ("push", $_,  "master", "--fore", "-v") 

    Micah, you can use start-job to run it in background –

    Git Baby is a git and github fan, let's start git clone.