TFS Power Tools for Visual Studio

The Team Foundation Server Power Tools for Visual Studio is a free add-on for VS 2010. If you are planning on or are currently working with TFS 2010, this is a must-have:
Alerts Explorer
A plug-in to Visual Studio, Alerts Explorer provides a graphical user interface that supports flexible subscription of alerts based on check-in, work item change, or build completion.
Team Foundation Server Backups
The tool can schedule backups for the following databases that your deployment of Team Foundation Server uses:
  • the configuration database
  • the database for each team project collection
  • the databases that Team Foundation Server uses in conjunction with SharePoint Products, if your deployment includes integration with SharePoint Products
  • the databases that Team Foundation Server uses in conjunction with SQL Server Reporting Services, if your deployment includes reports
By using the restore wizard included with this tool, you can restore your entire deployment to new hardware, or selectively restore team project collections to an earlier point in time.
Microsoft Team Foundation Server 2010 Best Practices Analyzer
To launch the Microsoft Team Foundation Server 2010 Best Practices Analyzer, click Start, point to All Programs, point to Microsoft Team Foundation Server 2010 Power Tools, point to Microsoft Visual Studio Best Practices Analyzer, and then click TfsBpa.exe.
Updated! A diagnostic tool with a graphical user interface that you can use to perform the following actions:
  • Verify that the deployment for Team Foundation Server is configured according to recommended best practices
  • Identify the source of problems in an unhealthy deployment.
  • Take a snapshot of the configuration of a deployment.
  • Obtain usage data about the volume of data stored or accessed in the past 14 days. Includes specific information about database tables that have a tendency to grow and that may need to be reduced in size.
Custom Check-in Policy Pack 
A supplemental set of four custom check-in policies to use to enforce software development practices during the check-in process.
Process Editor
An add-in to the Tools menu, the Process Editor provides a graphical user interface for editing Team Foundation Server process templates inside the Visual Studio IDE. This tool also provides a GUI for viewing the values assigned to all fields defined in a project collection.
Team Explorer Enhancements
Updated! This tool provides additional Visual Studio menu options and functions to support finding files under version control by status or wildcard, opening a folder using Windows Explorer from the Source Control Explorer context menu, and labeling files and folders in Source Control Explorer.  New in this release is the ability to easily search for work items and be able to easily rollback changes in version control.
Team Foundation Power Tool (TFPT.EXE) Tool
Updated! A command line tool that you can use to work with files and directories under version control, team projects, and work items. Some commands display a graphical user interface when run.
Team Members
An add-in to Team Explorer, this tool allows you to organize users into sub-teams and access a number of collaborative tools, such as IM and email, sharing of queries and links, and downloading and installation of custom Team Foundation components.
Windows PowerShell Cmdlets for Visual Studio Team System Team Foundation Server
This tool provides a Windows PowerShell interface that supports basic version control commands and a pipeline and glue to enable scripting.
Windows Shell Extensions
Updated! This tool provides integration with Windows Explorer and the common file dialogs. With this integration, you can perform many source control operations without having to run Visual Studio or a Team Foundation command-line tool.
Work Item Templates
This tool provides an add-in to the Team menu and a folder under each team project node in Team Explorer. With this tool, you can create, apply, capture, set, and organize default work item templates.
Test Attachment Cleaner
With the introduction of Visual Studio Test Professional 2010 & Visual Studio Premium/Ultimate 2010, testers can author manual and automated Test cases, configure the different diagnostic data collectors (as part of Test Settings), associate the Test Settings with Test Plan/Suites and then execute these test cases as part of Test Runs. The execution of a Test Run (whether automated or manual) generates a bunch of diagnostic data, which may be captured either automatically by the system or manually by the tester. This diagnostic data is critical in eliminating the “no repro” bug scenarios between the testers and developers. However, the downside of this rich diagnostic data captures is that the system/user generated diagnostic data, over a period of time, can grow at a rapid pace and start taking up database space.
In Visual Studio 2010, the database administrator has little or no control over what data gets attached as part of Test Runs. For example, she has no policy settings to limit the size of the data capture, or how long to hold the data before initiating a cleanup. The “Test Attachment Cleaner” addresses these issues by:
  1. Determining which set of diagnostic captures is taking up how much space AND
  2. Reclaiming the space for runs which are no longer relevant from business perspective.

Download TFS Power tools here:

SharePoint 2010 Get Current Username / Logged in User

Have been exploring the SharePoint Client Object Model and in particular the Javascript Object Model

While there are methods to get the current user info, you can also simply borrow the logged in username from the top right of the screen:

<script type="text/javascript">// <![CDATA[
 var Username = document.getElementById("zz16_Menu").innerHTML ;
 var end = Username.indexOf("<");
 var nameOnly = Username.substring(8, end);

// ]]></script>

This technique is a little complex for my liking however, so here’s a snappier way to grab the current login name (using Jquery):

var Username = $("#zz16_Menu").text();

Note that the #zz16 identifier will vary based on your Master page. Use the Firefox Web Developer tools or Internet Explorer F12 tools to find out what the ID should be on your SharePoint site.

Using this type of technique is definitely more brittle than actually using a CAML query however in my mind would be more performant than actually doing a lookup in the DB. Would love to know if someone knows the scoop on that..

Update 05/12/2011

As my colleague Colin pointed out – the name that appears on the top right can really be anything and can change – for example if a user gets married and their name changes. A better approach would be to retireve the value programmatically using SPServices ($%28%29.SPServices.SPGetCurrentUser ). As of version v0.6.1, you can also request the ID of the user by specifying fieldName: “ID”.  Much more stable to use in most scenarios:

	fieldName: "ID",
	debug: false

MSDN Quick Links

The MSDN Library homepage has a newish “beta” quick links section which is a great index for navigating in an easier way than the somewhat dense tree nav:

The specified file is not a valid spreadsheet or contains no data to import

Trying to import an Excel file in as SharePoint 2010 List resulted in the error:

The specified file is not a valid spreadsheet or contains no data to import

Double-checked the spreadsheet for formula errors, consistency etc. everything looked good but still no importo. The solution is to go to Internet Explorer > Internet Options > Security > Trusted Sites and add your SharePoint site to the list of trusted sites. You can use a *. to avoid having to list multiple subdomains, e.g. “https://*

The specified file is not a valid spreadsheet or contains no data to import

Be sure to disable the HTTPS checkbox if it’s not a requirement for your deployment.

Optimize images for web directly inside Visual Studio 2010

Probably in the 90s sometime, you achieved insider web design knowledge learning that you should not really be referencing a 4MB image file as little content image in a web page. Friends, family and associates we’re amazed as you made their Geocities pages suddenly 10X faster by replacing the image bloat. These days, the people who shoot you your imagery are generally a little smarter about fixing up their icons/logos/layout element images but there is ALWAYS more blood available to be squeezed from the stone of web images.

You still don’t believe just saving at 75% quality “for web” in Photoshop is the universal fix for web image optimization, do you? It’s not exactly life’s little joyful task to take what Joe the Marketing guy down the cube farm sent you for content or icons, and turning it into SEO and visitor-friendly pixel greatness. Especially when you’re a Developer who knows that fractional performance tuning (in this case, shaving off file size KB) in web application content is rarely going to be noticed by your team, unless it’s missing.

I found a nice little plugin for VS 2010 at that let’s you execute the tedious chore of image optimization directly inside VS 2010.

Adds a right-click menu to any folder and image in Solution Explorer that let’s you automatically optimize all PNG, GIF and JPEG files in that folder. The optimization doesn’t effect the quality of the images, but optimizes them using industry proven algorithms for removing EXIF and other metadata. The extension uses SmushIt and PunyPNG for optimizing the images. Check out the short video demo.

Recover from broken pages in SharePoint 2010

I’ve used various mod’s of this trick for different CMS’s over the years, here’s the one for SharePoint 2010 (thanks itgroove  Sean!).

So you’ve applied a new master page or page layout, tinkered with something you didn’t think was going to break in the UI, and now you’re left with a mangled wreck of a site layout  or an error screen you can’t seem to backtrack out of.

A simple thing to try: type in your site root and type in any page out of the main /_layouts folder, so something like:/

With any luck you will be returned to the pristine joy of the out-of-the-box SharePoint Master Page main site settings.