What I want to happen:
When a user clicks Refresh, it will detect the Shift and Control key states. When the NotifyIcon reloads if the keys are DOWN it will add the additional ADMIN menu options. When the user clicks Refresh again, and SHIFT and Control are not DOWN. It removes them. The full code is not listed with all functions.
If I launch the script using ISE, it detects the Key down states and adds the menu. Launching from Console it does not.
I have tried $Host.UI.RawUI option but I am unable to get it working properly. What am I missing.
How the script is being launched:
Script is launched from a logon Powershell script using the following command:
Start-Process (powershell.exe -WindowStyle Hidden -ExecutionPolicy bypass -File "\\pathtofile\trayicon.ps1") -WindowStyle Hidden