2

割り当てようとしています

  • CTRL+U
  • CTRL+ SHIFT+U

一部のPowerShellISEAddonmenu関数に割り当てられていますが、一部のWindows関数に割り当てられているようです。

現在のオンラインショートカットリストにもそれらが見つかりませんでしたか、他のアプリケーションにフォーカスがある場合でも使用されるグローバルショートカットを作成できるアプリケーションはありますか?

編集:

これはPowerShellISEの問題であり、一般的な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の問題ではなく、純粋なPowerShellISEの問題です。

事実は、ISEが使用することです

CTRL+ SHIFT+U選択範囲を大文字に変換し、

CTRL+U小文字に変換します。

謎は、これら2つの機能とそのショートカットを表示するメニューがないことです。

于 2011-06-26T09:35:46.873 に答える