Closed jcmarinn closed 1 month ago
Hello @jcmarinn,
I do not have Teams installed but as far as I know Teams does start several processes with each of it having potentially several windows so it would be luck if you obtain the handle of the correct window to move.
When I remember well the "classic" Teams starts more than one instance of teams.exe, you can check this with
Get-Process "teams"
Maybe you have luck when determing the handle of the main window with:
(Get-Process "teams")[0].MainWindowHandle
( [0] is here for the first found instance of teams.exe )
Sorry I cannot help more, but some programs - first of all browsers like Edge or Chrome) are designed this way.
Greetings
Markus
I assume that the issue no longer exists as there is no feedback.
I'm trying to move the Microsoft Teams App window to one of my desktops with this command:
Get-desktop 3 | Move-Window (Find-WindowHandle "Microsoft Teams") | Switch-Desktop
This works OK for other apps like Outlook, but I get the following error when I try with Microsoft Teams:
Find-WindowHandle "Microsoft Teams"
does return a handle correctly --> name of window changes depending on whats showing in TEAMS but it always ends with "Microsoft Teams" so Find-WindowHandle returns same handle every time.