Powershell Set-foregroundwindow / get-foregroundwindow

Topics: Developer Forum, User Forum
Oct 30, 2014 at 7:00 PM
I'm not sure how to use this syntax can you provide an example. I'm trying to automate a process that requires focus on a save as window.
Oct 31, 2014 at 3:40 AM
You provide the Window's handle to Set-ForegroundWindow and it will bring that window to the foreground e.g.:
start notepad.exe
Set-ForegroundWindow (Get-Process notepad).MainWindowHandle