Closed seiyria closed 2 years ago
Hello @seiyria,
this is a strange behaviour of Visual Studio Code. I managed to move all Visual Studio Code windows to desktop with number 1 with the following code:
Find-WindowHandle * | ? { $_.Title -match "Visual Studio Code" } | % { Move-Window -Desktop (Get-Desktop 1) -Hwnd $_.Handle }
I integrated the Find-WindowsHandle commandlet to PSVirtualDesktop in order to get Chrome tamed, but it might help here too.
Greetings
Markus
Thank you! That looks so much better than what I tried to cobble together. Having this information I think I'll be able to write the script I was planning out.
I'm running multiple instances of VS Code, but I see this:
Similarly, if I do this:
Now, I've figured out that I can do something like this to load a main window handle from a window title name:
(Get-Process | Where-Object { $_.MainWindowTitle -like '*code*' }).MainWindowHandle
However, if I run multiple VS Code instances, there's only ever one active at a time.
My goal is to script 5 VS Code instances across multiple virtual desktops (and ideally, chrome too, but I got stuck here), as well as pin a few applications.
Is there any way to do this?