Forum Discussion
amcglothin
May 10, 2020Copper Contributor
PowerShell script and Window Focus
I have a script that worked under Windows 10 1903. It does not work under Windows 10 1909. I'm hoping someone here can shed some light on what is happening and maybe suggest a workaround. I'm using Z...
amcglothin
May 11, 2020Copper Contributor
Animesh Joshi , thanks, but as I said I can get the script to run from a PowerShell console and it brings the window into foreground focus. But when the Touch Portal application calls the script, I just get a flashing Zoom icon in the taskbar and the Zoom window stays in the background. Not sure what setting breakpoints in the PowerShell ISE would do to show why the Window would stay in the background when called from the app. I'm still new at PowerShell and scripting though.
Animesh Joshi
May 11, 2020Brass Contributor
I understand script runs OK from powershell console. However, running the script in powershell ISE and adding breakpoints will give you an insight into what functions/binaries/DLLs are being called or what is the system state when script works. This will give you a under-the-hood idea.
You can then get the app to call the same script and launch sysinternals tools like procmon or procexp to review how your app is interacting with the same functions/binaries/DLLs
You can then get the app to call the same script and launch sysinternals tools like procmon or procexp to review how your app is interacting with the same functions/binaries/DLLs