microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

Command line task shows incomplete and out-of-order output from PsExec #192

Closed aplex closed 8 years ago

aplex commented 8 years ago

We are using PsExec to run commands on a remote machines. Unfortunately, build task that invokes psexec shows incomplete and out-of-order output.

For example, this command line task prints the content of disk C on a remote machine. Task parameters: Executable: c:\tools\psexec.exe Arguments: -accepteula -u user_name -p password \10.1.2.3 cmd /c dir c:\

Actual Build output contains only the first line from directory listing, and this line appears before the "connecting to":

Executing the following commandline. (workingFolder = C:\BuildAgents\1_work\yyy\xxx) cmd /c c:\tools\psexec.exe -accepteula -u admin -p 1 \10.1.2.3 cmd /c dir c:\ Error message highlight pattern: Warning message highlight pattern: PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com Volume in drive C has no label. Connecting to 10.1.2.3... Starting PSEXESVC service on 10.1.2.3... Connecting with PsExec service on 10.1.2.3... Starting cmd on 10.1.2.3... cmd exited on 10.1.2.3 with error code 0.


When I ran this command from command prompt directly, I get the correct output:

PsExec v2.11 - Execute processes remotely Copyright (C) 2001-2014 Mark Russinovich Sysinternals - www.sysinternals.com

Volume in drive C has no label. Volume Serial Number is 1029-938E

Directory of c:\

12/21/2015 03:00 PM

Program Files 01/22/2016 03:19 PM Program Files (x86) 11/18/2014 05:30 PM Users 01/22/2016 02:16 PM Windows <...>

cmd exited on 10.1.2.3 with error code 0.


When started from the command prompt, PsExec shows connection progress in the same line of the console by overwriting it multiple times. Maybe this breaks something in TFS build agent?

Build agent version: 1.89.1

bryanmacfarlane commented 8 years ago

Open an issue in the vso-agent-tasks repo

This repo is for the xplat linux and mac agent. Good news is we're merging agents into a core CLR agent and someday it will be in this repo.