I'm executing the following command in Powershell.
git log --branches --not --remotes --oneline
The goal is to get all non-pushed commits on all branches. Git displays the name of the branch in the output (in a different color). When I try to capture the command with
$foo = git log --branches --not --remotes --oneline
the variable $foo is missing the colored output. So it's not the same as what gets displayed on the screen.
How can I capture the same output that would be displayed?
Update Just to clarify, I don't care about the output being in color. My point was only that the colored output is not being captured at all, in color or not