2

我正在尝试分配

  • CTRL+U
  • CTRL+ SHIFT+U

到某些 PowerShell ISE Addonmenu 功能,但说似乎分配给某些 Windows 功能。

我也没有在当前的在线快捷方式列表中找到它们,或者是否有一些应用程序可以创建全局快捷方式,即使在其他应用程序具有焦点时也可以使用这些快捷方式?

编辑:

在认识到这是一个 PowerShell ISE 问题而不是一般的 Windows 问题后,我更改了标题。

这是代码

$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Test 1",{Write-host 'test 1'}, "CTRL+SHIFT+U") 
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Test 2",{Write-host 'test 2'}, "CTRL+U") 


Exception calling "Add" with "3" argument(s): "The menu 'Test 1' uses shortcut 'Ctrl+Shift+U', which is already in use by the menu or editor functionality.
Parametername: shortcut"
At line:1 char:52
+ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add <<<< ("Test 1",{Write-host 'test 1'}, "CTRL+SHIFT+U") 
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodTargetInvocation

Exception calling "Add" with "3" argument(s): "The menu 'Test 2' uses shortcut 'Ctrl+U', which is already in use by the menu or editor functionality.
Parametername: shortcut"
At line:2 char:52
+ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add <<<< ("Test 2",{Write-host 'test 2'}, "CTRL+U") 
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodTargetInvocation
4

1 回答 1

2

最后,在能够在 PowerGUI Script Editor 中创建此类菜单后,我找到了解决方案。

这不是 Windows 问题,而只是纯粹的 PowerShell ISE 问题。

事实上,ISE 使用

CTRL++将选择转换为大写SHIFTU

CTRL+U将其转换为小写。

神秘的是,没有显示这两个功能及其快捷方式的菜单。

于 2011-06-26T09:35:46.873 回答