4

Since support for macros has finished for VS11, is it possible to add a button to point to a powershell script (saved as a file, or somehow similar to a macro), or to execute a single powershell command?


Context This would be to kill all the webdev servers:

Stop-Process -processname WebDev.WebServer40

So if there's any other quick way to do that (other than typing the command/script path in the powershell enabled Package Manager Console or other console), would be useful.

StuperUser
  • 10,555
  • 13
  • 78
  • 137

1 Answers1

1
  1. Create an external command (Tools | External Commands) that does what you want.
  2. From the menu select Tools | Customize
  3. In the dialog go to the Commands tab
  4. Select the toolbar you want to add the command to
  5. Click Add Command
  6. In the popup locate the Tools category and select External Command N where N is the command number for your powershell call.

If the toolbar is visible as soon as you close the popup the command will appear in the toolbar with the name you gave it. Close the dialogs and you'll be all set.

Richard Banks
  • 12,456
  • 3
  • 46
  • 62
  • I've changed it to point at a .bat file with the command: `taskkill /im WebDev.WebServer40.exe` since it doesn't recognise .ps1s as executable and it's simpler to use the bat command than bring up Powershell. – StuperUser Apr 16 '12 at 08:58