Is there a way in Powershell to detect execute event keys\clicks used?

%3CLINGO-SUB%20id%3D%22lingo-sub-1612559%22%20slang%3D%22en-US%22%3EIs%20there%20a%20way%20in%20Powershell%20to%20detect%20execute%20event%20keys%5Cclicks%20used%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612559%22%20slang%3D%22en-US%22%3EI%20have%20a%20powershell%20script%20it%20executes%20when%20it's%20.ps1%20file%20opened%20in%20Powershell.exe%20by%20double%20clicking.%20When%20it%20is%20executed%20by%20using%20Ctrl%20%2B%20Return%20or%20Ctrl%20%2B%20Click.....or%20any%20other%20combination%20I%20want%20to%20detect%20that%20%26amp%3B%20use%20it%20in%20the%20code%20inside%20it.%20Idea%20is%20to%20give%20user%20a%20different%20results%20when%20he%5Cshe%20uses%20a%20particular%20combination%20of%20keys%20or%20click%20to%20execute%20it.%20Is%20there%20a%20straight%20forward%20code%20to%20detect%20it%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1612559%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor
I have a powershell script it executes when it's .ps1 file opened in Powershell.exe by double clicking. When it is executed by using Ctrl + Return or Ctrl + Click.....or any other combination I want to detect that & use it in the code inside it. Idea is to give user a different results when he\she uses a particular combination of keys or click to execute it. Is there a straight forward code to detect it?
1 Reply
you can read event from event log