title: Check out a repository from TFS via the command line
body: <p>I am trying to write a script (which will eventually be used in TeamCity) to check out a project from TFS via the command line. It should do this afresh each time i.e. create local workspace mapped to a working directory.</p>
  
  <p>I've found the page <em><a href="https://msdn.microsoft.com/en-us/library/y901w7se(v=vs.100).aspx" rel="nofollow noreferrer">Workspace Command</a></em>, and I believe I need to use the <code>workspace</code> command probably followed by <code>checkout</code>, but I'm not 100% sure. So far I have tried:</p>
  
  <pre><code>tf workspace /new &lt;MyMachineName&gt;;&lt;WindowsUsername&gt; /noprompt
  /collection:https://&lt;myrepo&gt;.visualstudio.com:8080/DefaultCollection/MyProject
  /permission:Private
  /location:local
  /filetime:checkin
  /login:&lt;TfsUsername&gt;,&lt;TfsPassword&gt;
  </code></pre>
  
  <p>which results in the error</p>
  
  <blockquote>
    <p>TF400324: Team Foundation services are not available from server  <a href="https://myrepo.visualstudio.com:8080/DefaultCollection/MyProject" rel="nofollow noreferrer">https://myrepo.visualstudio.com:8080/DefaultCollection/MyProject</a>.
    Technical information (for administrator):
      Unable to connect to the remote server</p>
  </blockquote>
  
  <p>I am using the developer command prompt for Visual&nbsp;Studio&nbsp;2012, and I <em>am</em> able to browse the repository via the web interface.</p>