2

I am trying to assign

  • CTRL+U
  • CTRL+SHIFT+U

to some PowerShell ISE Addonmenu functions, but say seem to be assigned to some Windows function.

I didn't find them in current online shortcut lists either or are there some applications which can create global shortcuts which are used even when other application have the focus?

Edit:

I changed the title, after recognizing, that this is a PowerShell ISE problem and no general Windows problem.

and here is the code

$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
Mwiza
  • 7,780
  • 3
  • 46
  • 42
bernd_k
  • 11,558
  • 7
  • 45
  • 64

1 Answers1

2

Finally, after being able to create such menus in PowerGUI Script Editor, I found the solution.

This is no Windows problem, but just a pure PowerShell ISE problem.

Fact is, that ISE uses

CTRL+SHIFT+U to convert a selection to uppercase and

CTRL+U to convert it to lowercase.

The mystery is, that there is no menu showing these two functions and their shortcuts.

Mwiza
  • 7,780
  • 3
  • 46
  • 42
bernd_k
  • 11,558
  • 7
  • 45
  • 64
  • But Visual Studio 2010 shows these functions in its Edit|Advanced menu. It would be better if ISE does the same. – bernd_k Jul 19 '12 at 10:49