Protecting PowerShell Scripts with Team Foundation Server (TFS)

PowerGUI Pro Script Editor 2.0 integrates with multiple source control systems. In this blog post I will guide you through setting it up to work with Microsoft Visual Studio Team Foundation Server.

First of all, the machine on which you are doing your script development needs to have the following prerequisites from Microsoft:

  • Microsoft Visual Studio Team Explorer – the setup ships with Team Foundation Server.
  • Install Team Foundation Server MSSCCI Provider – it is a free download from microsoft.com but you need to make sure you pick the same version as your VS installation: 2005, 2008, or 2010 (currently RC).

Now you are ready to start using TFS inside PowerGUI!

  1. Start PowerGUI Pro Script Editor
  2. In Tools / Options / Version Control / Current provider, select Team Foundation Server MSSCCI Provider.

Once you’ve done that checking in your scripts is trivial. When you save a script, you will be prompted whether you want to add it to the source control project:

And if you click Yes you will be able to pick the TFS server and project:

And then supply your check-in comments:

After that the Tab displaying the script will have a blue check indicating that the file is under source control, and you will be able to use Version Control menu or toolbar to check in/check out the file and perform other source-control-related operations:

One final comment to add, is that if this is a fresh machine and there already exists a TFS project which you want to join and from which you want to download all existing files, you may do so using the Visual Studio or Visual Studio Team Explorer. All you need to do is add the server/project in File / Source Control / Open from Source Control menu, then double-clicking Source Control in Team Explorer, and Getting Latest Version of the projects you need:

I hope this makes your scripting even safer and more compliant with your corporate policies.

5 Responses to “Protecting PowerShell Scripts with Team Foundation Server (TFS)”


  1. 1 Igor March 17, 2010 at 4:52 am

    Im running Windows 7

    Im using Microsoft Visual Studio 2010 Ultimate which i then connect to a Team Foundation Server.

    I downloaded and Install Team Foundation Server MSSCCI Provider and installed. I opened up PowerGUI Script Editor and when i go to Tools> Options> there is no Version Control.

    I do work at Microsoft.

    • 2 Dmitry Sotnikov March 17, 2010 at 9:52 am

      Igor,

      My guess is that you are using a freeware version of PowerGUI and version control is one of the few features which only appear in Pro.

      Could you try downloading the Pro version at http://www.quest.com/PowerGUIPro, installing it and verifying that this fixes the issue?

      Dmitry


  1. 1 Dew Drop – March 17, 2010 | Alvin Ashcraft's Morning Dew Trackback on March 17, 2010 at 2:59 pm
  2. 2 Subversion (SVN) Source-Control for PowerShell Scripts « Dmitry’s PowerBlog: PowerShell and beyond Trackback on April 9, 2010 at 10:01 am
  3. 3 Dynamsoft online source control in PowerGUI Script Editor « Dmitry’s PowerBlog: PowerShell and beyond Trackback on January 18, 2011 at 8:09 pm

Leave a comment




Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

March 2010
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031