I am writing automated tests to verify that my website works as expected on Microsoft's Edge browser. As a part of my testing, I need to set focus on another window, and then reset the focus back onto the Edge browser.
With other browsers, I can use Set-WindowActive or SetForeGroundWindow, but neither of those work for Edge. For example, the following code works on any other browser, but does NOT work with MS Edge:
$IE = Get-Process iexplore
Select-Window $IE | Set-WindowActive
I believe this is because other browsers are desktop applications, but Edge uses the Metro app interface instead. How can I set focus on a Metro/Win10 style app using powershell?