I want to position two notepad windows by sharing the screen, one window on the right and one on the left. For that, I only found one function that allows you to set the size and the position of a window in a powershell script.
See more here : https://superuser.com/questions/1324007/setting-window-size-and-position-in-powershell-5-and-6
However, using the same process notepad, I thought I would differentiate them with a different id but it doesn't work, both windows are placed in the same place.
Get-Process -Id 21900 | Set-Window -X -8 -Y 0 -Width 976 -Height 1038 -Passthru -Verbose
Get-Process -Id 14392 | Set-Window -X 952 -Y 0 -Width 976 -Height 1038 -Passthru -Verbose
I also tried to do a second function Set-Window2 and use start-job but it also doesn't work.
Get-Process -Id 21900 | Set-Window -X -8 -Y 0 -Width 976 -Height 1038 -Passthru
Start-Job -Scriptblock {Get-Process notepad | Set-Window -X 952 -Y 0 -Width 976 -Height 1038 -Passthru}
Get-Job
Is there a way to differentiate 2 windows with the same process ?