Home > Code, PowerShell > Team Foundation Services and PowerGUI – Using PowerShell with Version Control

Team Foundation Services and PowerGUI – Using PowerShell with Version Control

Version control allows you and others to work on the same scripts, check them in and out, etc. By following these steps, it is possible to use version control system for PowerShell as well as a number of other programming languages.

For PowerShell, PowerGUI is by far my favourite GUI/Script Editor, it is free, far superior to ISE (which is improving) and my preference to PrimalScript. Although PowerGUI is my preference for PowerShell development, for pretty much all other scripting, PrimalScript is superb.

Primal’s PowerShell Studio is an excellent PowerShell GUI/Script Editor. It has a similar feature set to PowerGUI, with some advantages and some disadvantages- one thing that it excels at is PowerShell GUI development.

One thing that PowerGUI, PowerShell Studio and PrimalScript all have in common, is that they support the MSSCCI provider/Source Control Plug-in API. The following guide shows you how to install the provider and configure PowerGUI to use it.

Requirements

Installation Instructions

As there are many options for TFS, I will not go into installation and setup of TFS. For the examples, I will be using Team Foundation Services Online.

  1. Install the PowerGUI Script Editor.
  2. Accept the license agreements and install the defaults.
  3. Launch setup for Team Explorer for Visual Studio 2012.
  4. Agree to the license agreement and press the Install button.
  5. Press the ‘Launch’ button once installation has completed.
  6. Launch the Microsoft Visual Studio Team Foundation Server 2012 MSSCCI Provider. This is the 32-bit installer and is required for PowerGUI and other script editors.

Configure Team Foundation Server Explorer

  1. Press the ‘Connect to Team Foundation Server’ and press the ‘servers’ button.
  2. Press ‘Add…’ and enter details of the Team Foundation Server. Press OK. (you may be prompted to sign in)
  3. Press the close button.
  4. Select the Team Projects you wish to import. Press ‘Connect’.
  5. Click the Source Control Explorer link.
  6. Right click and choose ‘Add Items to Folder’. Choose a PowerShell Script to upload.

Configure PowerGUI to use Team Foundation Server

  1. Launch PowerGUI Script Editor.
  2. Select the ‘Tools’ menu -> ‘Options’.
  3. Select ‘Version Control’. Select ‘Team Foundation Server MSSCCI Provider’. Click Advanced.
  4. Select Check In and press OK, and OK again.
  5. PowerGUI will now have a ‘Version Control’ menu.
  6. Choose ‘Get Files from Version Control’.
  7. The Team Foundation Server should be available in the list. Click OK.
  8. Expand $/ and select the project beneath.
  9. Click the ‘Browse’ button. Create a new folder for the local copy of the script repository.
  10. Press OK.
  11. After a few moments (depending on speed of connection to the TFS server) an Open dialog will be shown.
  12. Open the sample script.

Using Team Foundation Server with PowerGUI

  • Creating a new script in the folder linked with the repository will cause it to be uploaded to TFS.
  • Modifying a script checks it out.
  1. Kaleb
    July 30, 2013 at 10:37 pm

    Is this for PowerGUI or PowerGUI Pro? One is a free product, the other is not. I don’t see a TFS integration option in PowerGUI free, but I’m looking to integrate version control into my Powershelling, so I’m hoping I’m looking at the wrong version, or the wrong place or something..

    • Kaleb
      July 30, 2013 at 10:38 pm

      I just realized – I don’t have the TFS component installed.. do I need that before PowerGUI will work with TFS? If I install the TFS component now, do I have to reinstall PowerGUI?

      • July 31, 2013 at 9:14 am

        Hi,

        As long as you install the Team Explorer for Visual Studio 2012 first, then the Microsoft Visual Studio Team Foundation Server 2012 MSSCCI Provider, any application that supports the provider and it will work if installed before or after.

        As for PowerGUI Pro, that product no longer exists- the free version of PowerGUI now contains all the features of the pro version- I am no surprised as the pro features did not add a great deal.

      • Kaleb
        July 31, 2013 at 6:18 pm

        Thank you for the reply – I’m getting the TFS components installed and am looking forward to getting this setup. 🙂

  2. August 14, 2013 at 3:18 pm

    excellent instructions, thanks

  3. December 17, 2013 at 4:08 pm

    Wow, this article is pleasant, my younger sister
    is analyzing such things, thus I am going to tell her.

  4. February 7, 2014 at 3:42 pm

    I like looking through an article that can make men and women think.
    Also, thanks for permitting me to comment!

  5. February 8, 2014 at 7:07 pm

    Great post, in the past I was using SVN with Drop Box which was clunky to say the least, this is far simpler and works a treat!

  6. February 12, 2014 at 2:41 pm

    Does your blog have a contact page? I’m having a tough time locating it but, I’d
    like to send you an email. I’ve got some recommendations for your blog you might
    be interested in hearing. Either way, great site and I look
    forward to seeing it grow over time.

  7. March 3, 2014 at 2:40 pm

    I think the admin of this web site is in fact working hard
    in support of his web page, for the reason that here every information
    is quality based stuff.

  8. March 6, 2014 at 9:24 am

    Aw, this was an extremely nice post. Spending some time and actual effort to make
    a superb article… but what can I say… I hesitate a lot and don’t seem to get nearly
    anything done.

  9. March 7, 2014 at 3:46 am

    It is appropriate time to make some plans for the future and it is time to be
    happy. I’ve read this post and if I could I wish to suggest you some interesting things or suggestions.
    Perhaps you can write next articles referring to this article.
    I want to read even more things about it!

  10. March 14, 2014 at 7:29 pm

    Unquestionably believe that which you stated. Your favorite reason appeared to
    be on the web the easiest thing to be aware of. I say to you, I certainly get irked while people
    consider worries that they just don’t know about.
    You managed to hit the nail upon the top and also defined out the whole thing without
    having side-effects , people could take a signal.

    Will probably be back to get more. Thanks

  11. October 21, 2014 at 10:41 am

    Reblogged this on Memory Extension and commented:
    This is a very comfortable setup.
    Version Control combined with the (currently) best PowerShell editor.
    Best part is: it’s all free and very scalable.
    This setup can be used for teams of every size.
    Nicely written and structured article as well.

  12. October 21, 2014 at 10:42 am

    This is a very comfortable setup.
    Version Control combined with the (currently) best PowerShell editor.

    Best part is: it’s all free and very scalable.
    This setup can be used for teams of every size.

    Nicely written and structured article as well.

  1. No trackbacks yet.

Leave a reply to buy bulk followers Cancel reply