TFS commands in PowerShell script

前端 未结 1 1218
抹茶落季
抹茶落季 2021-01-05 10:29

I have a Powershell script written in the version 1.0. In this existing old script I need the facility to get the latest code of a project from TFS. I have TFS client on the

相关标签:
1条回答
  • 2021-01-05 11:10

    One option is to run the TF.exe program with the necessary arguments from within your PowerShell script, as you would with any other executable:

    PS> & "$env:ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe" @("workspace", "/new", "WS1", "/noprompt", "/login:foo,bar", "/collection:baz/tfs")
    

    Or you could use the TFS PowerShell cmdlets included in the TFS Power Tools:

    PS> Add-PSSnapin Microsoft.TeamFoundation.PowerShell 
    PS> Get-TfsChangeset -Latest -Server "http://mytfsserver"
    
    0 讨论(0)
提交回复
热议问题