I'm trying to write a script to connect to TFS using powershell, however I'm stuck on the part of actually connecting
$credentialProvider = new-object Microsoft.TeamFoundation.Client.UICredentialsProvider
$collection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($uri, $credentialProvider)
It gives an error that says it cannot find the type
[ERROR] New-object : Cannot find type [ERROR] [Microsoft.TeamFoundation.Client.UICredentialsProvider]: verify that the [ERROR] assembly containing this type is loaded.
Well I tried to do this first, but it did not help
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client")
I only have Visual Studio 2015 installed on my development environment. Is there some component that I'm missing that is a requirement for interfacing with TFS using powershell?
Furthermore I don't know where this script will be run from (it wont be from a development machine), presumably from a machine that has access to TFS server directly maybe using Team Explorer.