Nick
Nick

Reputation: 19684

Team Foundations Version Control - VersionControlServer - Get a list of folders and files from path?

I am new to working with the TFS API. Is there a way to query the VersionControlServer to get a list of folders an/or files given a path??

$/TeamProject/release/

Can I somehow get a collection of folders give this path?

Thanks

Upvotes: 1

Views: 1357

Answers (1)

alpha-mouse
alpha-mouse

Reputation: 5003

You can use this code:

var allItems = sc.GetItems("$/TeamProject/release/*");
var folders = allItems.Items.Where(t => t.ItemType == ItemType.Folder);

var folderPaths = folders.Select(f => f.ServerItem);

Upvotes: 3

Related Questions