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
-
Microsoft TFS Source Code Version Control System
-
- Free for up-to 5 people.
- Based online, hosted by Microsoft.
- Private
-
- Free for up-to 5 people.
- Private install.
- Designed for small teams to collaborate.
- Local
-
- For many users.
- Role based
- Feature Rich.
-
- Team Explorer for Visual Studio 2012
- Microsoft Visual Studio Team Foundation Server 2012 MSSCCI Provider
- PowerGUI Script Editor
- A test PowerShell script to upload to the repository.
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.
- Install the PowerGUI Script Editor.
- Accept the license agreements and install the defaults.
- Launch setup for Team Explorer for Visual Studio 2012.
- Agree to the license agreement and press the Install button.
- Press the ‘Launch’ button once installation has completed.
- 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
- Press the ‘Connect to Team Foundation Server’ and press the ‘servers’ button.
- Press ‘Add…’ and enter details of the Team Foundation Server. Press OK. (you may be prompted to sign in)
- Press the close button.
- Select the Team Projects you wish to import. Press ‘Connect’.
- Click the Source Control Explorer link.
- Right click and choose ‘Add Items to Folder’. Choose a PowerShell Script to upload.
Configure PowerGUI to use Team Foundation Server
- Launch PowerGUI Script Editor.
- Select the ‘Tools’ menu -> ‘Options’.
- Select ‘Version Control’. Select ‘Team Foundation Server MSSCCI Provider’. Click Advanced.
-
Select Check In and press OK, and OK again.
- PowerGUI will now have a ‘Version Control’ menu.
- Choose ‘Get Files from Version Control’.
- The Team Foundation Server should be available in the list. Click OK.
- Expand $/ and select the project beneath.
- Click the ‘Browse’ button. Create a new folder for the local copy of the script repository.
- Press OK.
- After a few moments (depending on speed of connection to the TFS server) an Open dialog will be shown.
- 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.
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..
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?
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.
Thank you for the reply – I’m getting the TFS components installed and am looking forward to getting this setup. 🙂
excellent instructions, thanks
Wow, this article is pleasant, my younger sister
is analyzing such things, thus I am going to tell her.
I like looking through an article that can make men and women think.
Also, thanks for permitting me to comment!
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!
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.
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.
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.
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!
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
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.
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.