简体   繁体   English

TFS 2017的Powershell cmdlet在哪里?

[英]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). 我在2008年迁移到2017年的TFS存储库上有一个带有TFSBuild.proj的2008年软件。我有一个TFS 2017构建代理,上面已经安装了Visual Studio 2017(15.7.6)。

There is only an automatic migration path from TFSBuild.proj to XAML builds. TFSBuild.proj到XAML构建只有自动迁移路径。 But XAML builds have for three years already been in the process of going away, per " Where is the TFS build process going? ". 但是,按照“ TFS的构建过程在哪里进行? ”,XAML的构建已经走了三年了。 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). 在2017年从2010年到2013年他们需要一个较旧的构建代理 ,而我只有我所说的2017年构建代理(和2008年构建代理)。

There is no automatic migration path to the somewhat unwisely named "vNext" build system. 没有自动迁移路径,该迁移路径的名称不太恰当,名称为“ vNext”的构建系统。 (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. (现在是“当前的”,并且阻碍了Microsoft的下一个构建系统的命名。)因此,我一直在手工编写自己的构建定义,手动转换旧的TFSBuild.proj曾经做过的事情。

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. 它曾经做过的一些事情涉及内部编写的DLL中的自定义MSBuild任务,例如使用Microsoft.TeamFoundation.VersionControl.Client等的任务。 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. 通过获取名称与特定模式匹配的最新标签,然后查看其所有项目的变更集ID,以获得用于最新成功构建的最新变更集。 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 . 这看起来像是在“ vNext”构建定义中调用另一个Powershell TFS cmdlet的另一个小巧的Powershell任务(我已经有一些)

Except that these do not appear to be available now. 除了这些似乎现在不可用。 They were in the TFS Power Tools in earlier versions of TFS. 它们位于TFS早期版本的TFS Power Tools中。 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. TFS 2017发行说明说,没有用于TFS 2017的Power Tools,并声称已将它们集成到TFS中。 This does not appear to be the case for my TFS 2017 build agent: 我的TFS 2017构建代理似乎不是这种情况:

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. 如果可以的话,我宁愿拥有Microsoft cmdlet,而不是为了跟随我的程序员自己做。 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* . 我建议通过执行get-command * tfs *进行一些搜索。 If tfs really doesn't come with commands, consider looking at the psgallery. 如果tfs确实不附带命令,请考虑查看psgallery。 There are probably already cmdlets for tech you're trying to manage on the gallery. 您可能已经在图库中尝试管理的cmdlet。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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