PowerShell hotkeys, use it inside the script, how?

Colleagues, prompt how it is possible within a Powershell script to process hotkeys when running the script (creating your own). D. run the script, press ctrl+1 and we have some action going on (in advance of us envisaged), i.e. in the script we need to catch the hotkeys, how can I do that?

Complement question as an example: there is a user who works with text, and it needs some constant pieces of text to insert, a lot of these pieces, I paste these pieces to see on hot keys. ie, a file to be formed with the pieces or even push them into variables, and then invoke hotkey in the active window (not Powerline, and programs), the specific need at the moment, a piece of text.
March 12th 20 at 08:08
2 answers
March 12th 20 at 08:10
need more information. describe the usage scenario of this functionality in more detail.
while I could think only this: run the script, it gives out menus and hot keys we can select the menu items. but it is not necessary to intercept hotkeys. it just can be made to respond to typed characters:

----MY MENU----
1. Press 1 for this option
2. Press 2 for this option
Q. Press Q to quit
Good day, there is this idea, there is a user who works with text, and it needs some constant pieces of text to insert, they are many of these pieces, I wanted to see on hot keys. Ie, a file to be formed with the pieces or even push them into variables, and then invoke hotkey in the active window (not Powerline, and programs), a specific piece of text. - angelo_Bogisich commented on March 12th 20 at 08:13
then you do not need PowerShell.
https://alternativeto.net/software/phraseexpress/?...
such softin million. - brown_Kuvalis49 commented on March 12th 20 at 08:16
@brown_Kuvalis49, Thanks, I will look - angelo_Bogisich commented on March 12th 20 at 08:19
March 12th 20 at 08:12
You do not truly understand the process of functioning hotkeys.
When you press a combination of any of key event is generated, for which Nikolay Petyukh gave a link.
This event is passed to the active window. In the script the window just yet.
You can handle user input (if being run interactively) or system events, available to all processes in the system.

Find more questions by tags HotkeysPowerShell