简体   繁体   中英

Where are the Powershell cmdlets for TFS 2017?

I have a 2008 software with a TFSBuild.proj on a TFS repository that has been migrated from 2008 to 2017. I have a TFS 2017 build agent on which has been installed Visual Studio 2017 (15.7.6).

There is only an automatic migration path from TFSBuild.proj to XAML builds. But XAML builds have for three years already been in the process of going away, per " Where is the TFS build process going? ". In 2017 they require an older build agent from 2010 to 2013 , and I only have a 2017 build agent as I said (and 2008 build agents).

There is no automatic migration path to the somewhat unwisely named "vNext" build system. (It's now "current", and rather obstructs naming Microsoft's next build system. ☺) So I have been writing my own build definition by hand, hand-converting what the old TFSBuild.proj used to do.

Some of what it used to do involved custom MSBuild tasks in a DLL written in-house, such as one using Microsoft.TeamFoundation.VersionControl.Client et al. to obtain the latest changeset for the latest successful build, by obtaining the latest label whose name matches a particular pattern and then looking at the changeset IDs of all of its items. This seems like a shoo-in for another (I already have some.) nice little Powershell task in the "vNext" build definition, calling the Powershell TFS cmdlets .

Except that these do not appear to be available now. They were in the TFS Power Tools in earlier versions of TFS. The TFS 2017 release notes say that there are no Power Tools for TFS 2017, and claim that they have been integrated into TFS proper. This does not appear to be the case for my TFS 2017 build agent:

PS C:\> Get-TfsServer
Get-TfsServer : The term 'Get-TfsServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-TfsServer
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-TfsServer:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\>

I'd rather have the Microsoft cmdlets if I can, rather than make my own, for the sake of the programmer that comes after me. After all, I am that programmer, dealing with in-house extensions created for the build system before last.

So what are my options?

I'd recommend doing some searches by doing get-command *tfs* . If tfs really doesn't come with commands, consider looking at the psgallery. There are probably already cmdlets for tech you're trying to manage on the gallery.

Try: find-command *tfs* or find-module *tfs*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM