Get full list of available commands for DTE.ExecuteCommand

霸气de小男生 提交于 2019-12-02 22:39:32

A list of commands can be examined by following this procedure:

  • Open Visual Studio's Options Dialog Box
  • Select the Environment/Keyboard page
  • You can search for a specific command in the "Show commands containing:" box, or just scroll the list behind it.

You can use immediate window to do it. Simply type '>' and start typing command.

Question is a bit old, but I ran into the same recently. I used the Commands collection from EnvDTE.DTE (here), that can be retrieved in a few lines of power shell. As you mentionned, the list is very long, and you may want to filter the output.

# Get Visual Studio 2015 type
# -- find other version in registry HKEY_CLASSES_ROOT\VisualStudio.DTE.x.x
$type = [System.Type]::GetTypeFromProgID("VisualStudio.DTE.14.0")
# Create an instance of EnvDTE.DTE - actually launches a devenv.exe process
$dte = [System.Activator]::CreateInstance($type,$true)
# list of Commands is output simply when typing : Can be very long
$dte.Commands
# Will output the name of the command, its GUID and other attributes
# Close process when done
$dte.Quit()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!