Search code examples
powershellkeyboard-shortcutsshortcut-file

Define shortcut key for shortcut in PowerShell


I want to create PowerShell script that makes a shortcut but i couldn't find function to define Shortcut key: for created shortcut. I mean, when Properties of shortcut are opened there is an input field for Shortcut key, is there any function to define it in PowerShell?


Solution

  • I've just found the solution:

    https://blogs.technet.microsoft.com/heyscriptingguy/2008/11/03/hey-scripting-guy-how-can-i-add-a-windows-powershell-shortcut-to-the-quick-launch-toolbar/

    Function is HotKey. Something like this: $shortcut.HotKey = "CTRL+1"