Announcing posh-tf

As you may or may not know, I’ve been a fan of Git for a while now. I’ve hacked on an implementation of it, I’ve presented on it, I’ve even built a PowerShell environment for it that’s used by at least twelve people that aren’t related to me. Until a few months ago, I was content in my little Git bubble.

But recently I’ve been working with a team that has broadened my horizons and imparted a valuable lesson to me: “there’s nothing Git can do that TFS can’t.” Now if you’ve been following me for a while, you know this has been patently untrue. Until today.

Announcing posh-tf

Obviously the killer feature that TFS lacks as an alternative to Git is that it doesn’t integrate well with PowerShell. According to the UserVoice suggestion, at least one person thinks this needs to be remedied. And so I am pleased to present posh-tf: a PowerShell environment for Team Foundation.

posh-tf provides everything that posh-git provides, except for the things that aren’t readily available from tf.exe:

  • No current branch information
  • No file status information
  • No tab completion for new, modified or deleted files
  • No tab completion for branches, shelvesets, etc

Actually, it would probably be easier to just list what it does provide:

  • Tab expansion for commands: tf ch<tab> expands to tf checkout
  • Tab expansion for help: tf help ch<tab> expands to tf help checkout
  • A prompt hook if someone can figure out a way to get current directory status.

Can’t wait to get started? The readme has everything you need!

I’m thrilled with what I have to release today, and am looking forward to working with the TFS community to make posh-tf even better!

About Keith Dahlby

I'm a .NET developer, Git enthusiast and language geek from Cedar Rapids, IA. I work as a software guru at J&P Cycles and studied Human-Computer Interaction at Iowa State University.
This entry was posted in posh-git, posh-tf, powershell. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Akash Chopra

    You might want to fix the “Add post footer plugin” link. Looks like you’ve been hacked.

  • Tom de Koning

    All good, but how fast is it compared to git?

    • The posh-tf prompt is consistently faster than the posh-git prompt.

      It also doesn’t show anything.

  • Michael Sumerano

    I happened upon this searching for something else. I have already written such a beast for my company and had planned on blogging about it. However, I’d prefer to just share the code with you, have you rip it apart, fix it, and allow it to benefit the public. Though, it’s nothing like posh-git or posh-hg, it does show you the server changeset # vs. the workspace changeset # when they’re different). And, I have a bunch of additional commands to shorten the command line for the most common ways we use them (either tf.exe or tfpt.exe). Lastly, with TFPT, a set of PowerShell cmdlets is packaged and they are faster than the standard commands. I’ve incorporated them somewhat into my posh profile. Please email me if you’re interested and I’ll package up the whole lot. Come to think of it, maybe I’ll just stick them out there in a public repo.

    • Thanks for sharing! How does having changeset information in the prompt affect performance?

      • Michael Sumerano

        Kinda stinks. So, I try to detect what the current directory is in conjunction to the mapping and cache it so that it’s not constantly checking. Once it gets it the first time, it doesn’t update it again until the global variables are cleared (and there’s a defect with it somewhere that clearing it doesn’t force it to refresh the changeset). And, just to give you an idea of our infrastructure, I perceive that it stinks based on the fact that my office’s physical location is ~60 miles away from the DC where the server is hosted (on a VMWare ESX cluster). Your mileage may vary and mine might, too, once we get a TFS proxy server installed in my physical location.