Q:

How do I repair my VSOAgent folder on my VM

I was "enhancing" my release pipeline process and managed to screw it up. I was getting a conflict in the version of the VSTest agent I thought I was supposed to be running and I deleted the VSOAgent folder because I thought it got recreated on each deployment. Now I am getting the error message:
2020-04-11T16:49:17.8418454Z ##[error]Downloading artifacts failed: System.IO.DirectoryNotFoundException: Directory not found: 'c:\DynamicsSDK\VSOAgent\externals\git\cmd'
I'm sure there are other things missing since I deleted most of the subfolders. How do I repair this and recover the VSOAgent structure?

A:

How do I repair this and recover the VSOAgent structure?

Sorry for any inconvenience.
Microsoft does not provide that feature or option to repair the private agent or recover the private folder structure. Because the private agent is created and maintained by ourselves.
The best way to solve this issue is that delete the old private agent and then create a new private agent. I believe that creating a private agent is not a difficult task now.
Note: The folders under the folder _work will be recreated on each build, but the best way to maintain the private agent is that using scheduled for the Agent/Pool instead of manually cleaning "_work" folder.
You could check this similar topic and the document for some more details.
Hope this helps.

