In order to automate our deployments, I would like to rebuild an application, based on a given ChangeSetId. Once this build has completed, I want to get the artifacts of the build (the .exe), so we can deploy them. For the sake of the question, I am focussing on the 'Get artifacts from build' part.
For DevOps purposes, I'd like to use PowerShell, since it should be able to access the TFS API libraries and because MS recommends using it.
Environment
I've set up Builds in our On-Premise TFS 2015 server (which are working neatly) - and added a VSO task 'Publish artifacts' after this build. So far so good. The published artifacts are to be stored on the Server, which basically means I have to download the artifacts connected to build - every existing build will have its artifacts linked - which is better than a UNC drop in my book.
No comes to my challenge; how do I programmatically access these artifacts, step 3?
1. Get Sources for ChangeSetId
2. MSBuild application with a given configuration
3. Get build Artifacts using PowerShell
4. Deploy to the environment using Release Management (Powershell as well)