DISCLAIMER: I'm new to PowerShell - I watched a few tutorials on YouTube.
THE-PROBLEM: Before work I need to do the following: (I have a 3 screen/monitor setup)
- open VSCode
- maximize VSCode on my middle screen
- open 4 (four) instances of powershell
- dock the powershell windows on my left-hand side screen and dock them (top-left, top-right, bot-left, bot-right) - I need 4 instances, because I have multiple different processes running at the same time
- open Chrome
- maximize Chrome on my right-hand side screen
I figured out how to open the apps I need at a certain path, but that's about it :(
Start-Process -FilePath 'C:\Users\...\Code.exe' -ArgumentList 'C:\repos'
Start-Process -FilePath 'C:\Windows\...\powershell.exe' -ArgumentList 'C:\repos'
I didn't find any commands in the PowerShell documentation with which I could get a reference to the monitors connected to my PC.
Long story short - this is what i need to do, written in pseudo-code:
// $screenMid = get the mid screen object (reference)
// $vscodeIinstance = open VSCode at a path
// $vscodeIinstance.position = $screenMid.position.maximize()
// $screenLeft = get the left screen object (reference)
// $powershellWindowOne = open PS at a path
// $powershellWindowOne.position = $screenLeft.position.dockTopLeft()
// $powershellWindowTwo = open PS at a path
// $powershellWindowTwo.position = $screenLeft.position.dockTopRight()
// ...do the same for another two PS windows (dockBotLeft, dockBotRight)
// $screenRight = get the right screen object (reference)
// $browser = open browser with url
// $browser position = $screenRight.position.maximize()
I've been doing this every single workday for some time now, so I'm trying to automate the full process.
It's been a couple of days since I started looking for a solution. No luck so far.
Thank you all for help!