I am running a bunch of git commands, as well as make and gcc through the Git SDK on Windows. I am doing this through Powershell. My code looks like this:
& 'C:\git-sdk-64\git-bash.exe' -lc 'git status'
As you can see, I'm using the call operator, which means that whenever the git-bash.exe is called, it opens in a new window where all of it's output is sent, and then the window closes and the output is lost. How can I redirect this output to the parent Powershell instance? I tried using Invoke-Command, Invoke-Expression and Start-Process, but I couldn't figure out a configuration that works.
UPDATE: I tried using Start-Process again, and got it to run:
Start-Process -Wait 'C:\git-sdk-64\git-bash.exe' -ArgumentList "-lc 'git status'" -NoNewWindow
As you can see, I'm using the NoNewWindow argument, and still a new window is being opened.