locked
Using power shell to start a test run - Which one to use from Rest API or Client libraries? RRS feed

  • Question

  • Hi,

    To start a test run from a powershell script, previously i used to access data by querying TFS database. Now, i want to refactor this to use TFS API. But there are two API's available. One is Rest API & other one is Client Libraries. Which approach is advisable? 

    My doubt is, Why Rest API has introduced? Does the TFS API get deprecated in the future? 


    sekhar

    Wednesday, February 28, 2018 7:52 AM

Answers

All replies

  • Hi,

    You could use both of the Rest api and client libraries(object model) to achieve that, and we will not deprecate the client api. But actually we suggest that you use the Rest api, because it is much easier to use the Rest api than the client api.

    And you could also use the Rest api in the client libraries, you just need to install the nuget package in the following path:

    https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/

    The Dlls in the nuget package actually also calls the Rest api URL, and you could use it easily in your client. You could refer to the samples in the following link:

    https://github.com/Microsoft/vsts-dotnet-samples/tree/master/ClientLibrary/Snippets/Microsoft.TeamServices.Samples.Client


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Limitxiao Gao Thursday, March 1, 2018 7:45 AM
    • Marked as answer by RAVISANGAM Monday, March 5, 2018 6:47 AM
    Thursday, March 1, 2018 7:44 AM
  • Thank you.

    sekhar

    Friday, March 2, 2018 6:05 AM
  • Hi,

    If you have no problems about it, could you please mark limitxiao's reply as an answer which will be helpful for those who has the similar doubt with you?

    If not, please feel free to let us know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 2, 2018 9:02 AM