I am writing a Powershell script as part of a Visual Studio Team Services build, this build uses the built-in build controller. The script is designed to check the file, make changes and check it back.
In a script, I'm trying to call a command tfto create a new workspace, but I'm having authentication issues. Team
& $tf vc workspace /new $tempWorkspaceName /collection:https:
causes an error:
TF30063: You do not have access to https://mycollection.visualstudio.com/ .
How can I access TFS from my Powershell script without embedding logins or passwords in the script? Can I access TFS in the context of the build agent, which itself is part of TFS? Or is there another way I have to do this?
Note that I did not use the TFS Power Tool cmdlets, as this is a hosted assembly server. Using TFS RestAPI is also not an option, since there is no way to check the file in or out.
source
share