The work directory is typically located:
- Self-hosted agent:
-
C:\agent\_work
on Windows -
~/agent/work
on macOS -
/home/agent/_work
on Linux.
-
You can use File Explorer or command-line tools like dir
or Get-ChildItem
to view the contents of the _work
directory:
dir C:\agents\<agent-name>\_workor in PowerShell:
Get-ChildItem C:\agents\<agent-name>\_work
- Microsoft-hosted agent:
-
C:\a
on Windows, -
/Users/runner/work
on macOS -
/home/vsts/work
on Linux.
-
You can use pipeline tasks to list the contents of the working directory:
- For Windows:
- script: dir %AGENT_WORKFOLDER% displayName: 'List Working Directory Contents'For Linux:
- script: ls $AGENT_WORKFOLDER displayName: 'List Working Directory Contents'
The work directory structure is as follows:
- /work directory
- /1 build directory/pipeline workspace
- /s source/working directory
- /b binaries directory
- /a artifacts staging directory
- /TestResults Test results directory