Search Wiki:

PowerCommands 1.1

PowerCommands 1.1 is a set of useful extensions for the Visual Studio 2008 adding additional functionality to various areas of the IDE. The source code is included and requires the VS SDK for VS 2008 to allow modification of functionality or as a reference to create additional custom PowerCommand extensions. Visit the VSX Developer Center at http://msdn.com/vsx for more information about extending Visual Studio.

The Releases page contains download files (MSI installation file, readme document, and source code project).

PowerCommands.jpg

Below is a list of the included in PowerCommands for Visual Studio 2008 version 1.1. Refer to the Readme document for additional command details and screenshots.

Enable/Disable PowerCommands in Options dialog
This feature allows you to select which commands to enable in the Visual Studio IDE. Point to the Tools menu, then click Options. Expand the PowerCommands options, then click Commands. Check the commands you would like to enable.
Note: All power commands are initially defaulted Enabled.

Format document on save / Remove and Sort Usings on save
The Format document on save option formats the tabs, spaces, and so on of the document being saved. It is equivalent to pointing to the Edit menu, clicking Advanced, and then clicking Format Document. The Remove and sort usings option removes unused using statements and sorts the remaining using statements in the document being saved.
Note: The Remove and sort usings option is only available for C# documents.
Note: Format document on save and Remove and sort usings both are initially defaulted OFF.

Clear All Panes
This command clears all output panes. It can be executed from the button on the toolbar of the Output window.

Copy Path
This command copies the full path of the currently selected item to the clipboard. It can be executed by right-clicking one of these nodes in the Solution Explorer:
The solution node; A project node; Any project item node; Any folder.

Email CodeSnippet
To email the lines of text you select in the code editor, right-click anywhere in the editor and then click Email CodeSnippet.

Insert Guid Attribute
This command adds a Guid attribute to a selected class. From the code editor, right-click anywhere within the class definition, then click Insert Guid Attribute.

Show All Files
This command shows the hidden files in all projects displayed in the Solution Explorer when the solution node is selected. It enhances the Show All Files button, which normally shows only the hidden files in the selected project node.

Undo Close
This command reopens a closed document , returning the cursor to its last position. To reopen the most recently closed document, point to the Edit menu, then click Undo Close. Alternately, you can use the CtrlShiftZ shortcut.
To reopen any other recently closed document, point to the View menu, click Other Windows, and then click Undo Close Window. The Undo Close window appears, typically next to the Output window. Double-click any document in the list to reopen it.

Collapse Projects
This command collapses a project or projects in the Solution Explorer starting from the root selected node. Collapsing a project can increase the readability of the solution. This command can be executed from three different places: solution, solution folders and project nodes respectively.

Copy Class
This command copies a selected class entire content to the clipboard, renaming the class. This command is normally followed by a Paste Class command, which renames the class to avoid a compilation error. It can be executed from a single project item or a project item with dependent sub items.

Paste Class
This command pastes a class entire content from the clipboard, renaming the class to avoid a compilation error. This command is normally preceded by a Copy Class command. It can be executed from a project or folder node.

Copy References
This command copies a reference or set of references to the clipboard. It can be executed from the references node, a single reference node or set of reference nodes.

Paste References
This command pastes a reference or set of references from the clipboard. It can be executed from different places depending on the type of project. For CSharp projects it can be executed from the references node. For Visual Basic and Website projects it can be executed from the project node.

Copy As Project Reference
This command copies a project as a project reference to the clipboard. It can be executed from a project node.

Edit Project File
This command opens the MSBuild project file for a selected project inside Visual Studio. It combines the existing Unload Project and Edit Project commands.

Open Containing Folder
This command opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node

Open Command Prompt
This command opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively.

Unload Projects
This command unloads all projects in a solution. This can be useful in MSBuild scenarios when multiple projects are being edited. This command can be executed from the solution node.

Reload Projects
This command reloads all unloaded projects in a solution. It can be executed from the solution node.

Remove and Sort Usings
This command removes and sort using statements for all classes given a project. It is useful, for example, in removing or organizing the using statements generated by a wizard. This command can be executed from a solution node or a single project node.

Extract Constant
This command creates a constant definition statement for a selected text. Extracting a constant effectively names a literal value, which can improve readability. This command can be executed from the code editor by right-clicking selected text.

Clear Recent File List
This command clears the Visual Studio recent file list. The Clear Recent File List command brings up a Clear File dialog which allows any or all recent files to be selected.

Clear Recent Project List
This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a Clear File dialog which allows any or all recent projects to be selected.

Transform Templates
This command executes a custom tool with associated text templates items. It can be executed from a DSL project node or a DSL folder node.

Close All
This command closes all documents. It can be executed from a document tab.
Last edited Apr 12 2008 at 4:54 AM  by klevy, version 15
Comments
segFault wrote  Mar 24 2008 at 11:54 PM  
I have been testing coderush and refactor. I really hope this works as a replacement for them as they are pricy (I'm not tight, just skint)... We shall see, hats off to you for these extra bits. Really appreciated.

Argbeil wrote  Apr 18 2008 at 1:47 PM  
This has nothing to do with features of CR or Refactor and NO - it won't work as a replacement for them.

MoTiOnXml wrote  Jun 25 2008 at 12:05 AM  
It's a great suite of add-ins to VS 2008. I've been using the Power Commands suite for quite some time now and especially the collapse feature is a real time saver. One feature I'm missing in the current release is the ability to sort using-statements on an entire project / solution (i.e. not the current "Remove and Sort Usings" feature) with an extra linebreak between each distinct root namespaces. Please see the following example:

using System;
using System.Xml;

using SphereWorks.Cms.Publishing;
using SphereWorks.Cms.Publishing.Model;

using log4net;

Also, it'd be really nice if the "Sort and Remove .." feature automatically actually deleted the lines containing the unncessary using statements instead of leaving them blank. However, aside from these minor issues I'm really happy with the features. We're using the suite all over the company.

MatteoSp wrote  Jul 31 2008 at 11:24 PM  
"with an extra linebreak between each distinct root namespaces"

+1, totally agreee

Munich wrote  Aug 25 2008 at 3:44 PM  
In About Visual Studio stil PowerCommand Visual Studio 2008 1.0 is displayed althoug i have installed 1.1

gatorspike wrote  Aug 27 2008 at 6:36 PM  
download the code and have it add the line between root namespace and you'll have what you want.

EricWilliams wrote  Sep 3 2008 at 2:33 AM  
After going into Tools > Options > PowerCommands > Command and Unchecking "Undo Close" and pressing Ok I would assume that it would be disabled. After restarting VS it keeps coming back. After rechecking the options dialog it is still 'unchecked'. How do I disable this Power Command item?

southwynd wrote  Oct 29 2008 at 11:07 PM  
After using the add-ins for a few days, I'm hooked. Great job. However, I've been unable to get the "Undo Close" feature to work. I tried disabling it and it won't go away. I'm using VB.

nhattran wrote  Nov 24 2008 at 8:06 PM  
When I tried to add an item to my toolbox, Visual Studio 2008 SP crashed with this message in the Event Log

.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506)

After I uninstalled PowerCommand, the problem disappeared. People said that there is a work-around for this bug. However, I will hold off using PowerCommand until they fix this bug, because I suspect that PowerCommand may cause problems in other areas as well.

stingray2772 wrote  Dec 4 2008 at 8:57 PM  
FIX THE BUGS! This tool seems to be poorly written. More harm than good, I'll wait for a bug fix like the rest of the guys...

dilbert789 wrote  Dec 9 2008 at 10:30 PM  
Installed PowerCommands 1.1 Looked pretty good. Till I tried to open a XAML file and VS2008 closes. Tried several different files and all get the same behavior. Closed VS, uninstalled PowerCommands and the files open fine.

I get the same error in the event log as nhattran.

canbilteknoloji wrote  Jan 18 at 1:26 PM  
Ich möchte euch allen Team Mittglieder danken, dass ihr uns ermöglicht, an solch Wertvollen Informationen zu gelangen.

http://www.canbilteknoloji.com

eralper wrote  Jan 22 at 7:28 AM  
Unfortunately I had to remove the PowerCommands just because of the problem it causes during adding items to toolbox. After uninstall the VS2008 is not crashing any more. I'm expecting a bug fix which can handle this problem. I liked to use the PowerCommands utilities a lot.

http://www.kodyaz.com

mpaladino wrote  Feb 17 at 5:09 PM  
For those of you having problems with the Fatal Execution Error when adding items to the toolbox, see http://www.mpaladino.com/post/FIX-Visual-Studio-PowerCommands-2008-Crashes-Visual-Studio-2008-SP1.aspx for a fix.

sondlerd wrote  Mar 24 at 1:03 AM  
Very cool set of useful tools. I have been waiting for the feature to close all projects in a solution. Nice! 3 issues that I have encountered... the undo close is buggy and sometimes the feature to remove all of the unused using statements conflicts when I am building. For the feature "Reformat on Save" can reek havoc on a source control system if users have different formatting settings saved! nice work, thanks for the tool.

MihaiLazar wrote  Apr 14 at 12:22 PM  
The source code is awfull. You call uppon a subclass to provide access to a member from the super class.
Hint: DynamicCommand line 48

GreenKnight66 wrote  May 7 at 6:17 PM  
I have a suggestion for the next version. In my current enviornment, I have had to pull large solutions from a source-control system, but then manually make changes to each project to make sure my reference paths match my central assembly location. This is tedious and time-consuming. I would like to see the ability to update the reference paths to all projects from a single solution-level context-menu item.

Eidos wrote  Jul 3 at 5:10 PM  

Fix for this, please !!! I trust in Microsoft, please, fix it, misters


VS 2008 closes at build, Outlook 2007 Add-In
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/99e124d0-c5d7-49c0-b1dd-71328f9a6571

Frane wrote  Oct 18 at 11:32 AM  
Hy :)
I must say this is very useful add-in! And I have a suggestion for the next version. Could you in Solution Explorer add a function "Edit in Expression Blend" when we right click on WPF .sln? Expression Blend has option "Edit in Visual Studio", but most of coders first start project in VS, not in Blend :)

sorin wrote  Oct 25 at 6:42 AM  
Please update the page and let others know that at least the C/C++ reformatting is not available in the plugin.

Updating...
Page view tracker