Access artifacts path in Powershell




I recently configured a buildserver which compiles and builds my C# solution just fine.

I'm building it with MSBuild by the way, no Visual Studio is installed.

So now, I want to deploy my /bin folder to another server.


Here is the Problem:

At the build config I've set the following artifact path: src\PROJECTNAME\bin\Debug =>

The location of the zip is: C:\TeamCity\buildAgent\system\.artifacts_cache\localhost_9191\httpAuth\repository\download\CONFIGNAME\8.tcbuildid, and there is my

The thing is that I can't change the left part (C:\TeamCity\buildAgent\system\.artifacts_cache\localhost_9191\httpAuth\repository\download\CONFIGNAME), just the right part apparently.

Even if I set the <teamcity Data directory> it doesn't solve my problem, as the deep structure and variable folder name (8.tcbuild) still exists, just at another location. Maybe it is possible to get the variable folder name out? so it overwrites with every sucessfull build?

So, apparently I can't create an artifact zip outside the Data folder.

But there has to be a way to access the path, isn't it? I can't find a parameter, which I could use for a PowerShell script.


Could you show me a solution, how I can generate an artifact zip by TeamCity and then access and use the zip by PowerShell and, for example, copy it to another location? Or better, to independent set the destination folder which isn't in the teamcity Data directory? Like src\PROJECTNAME\bin\Debug => C:\


Thanks in Advance!

1 comment
Comment actions Permalink

Hello Maxim,

If you create an artifact in build configuration A and configure an artifact paths, then this artifact is published on the build server. Then you can configure artifact dependency from B build configuration to A. When build B starts, it will download needed artifact from the server.

If you have any further questions, please do not hesitate to ask.


Please sign in to leave a comment.