The following powershell command works as expected:
get-process | tee-object -filepath C:\Test1\testfile2.txt
But if I change it to:
git pull | tee-object -filepath C:\Test1\testfile2.txt
I see the git pull command execute normally but C:\Test1\testfile2.txt still has the output from get-process.
Any idea why?
gm : You must specify an object for the Get-Member cmdlet. At line:1 char:12 + git pull | gm + ~~ + CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
– Eric May 16 '17 at 16:43Tee-Object
. Maybe git output is to stderror, so trygit pull 2>&1 | tee-object -filepath C:\Test1\testfile2.txt
– LotPings May 16 '17 at 18:22