I am setting up a monitor screen. Because of the compatibility with different web pages viewed running a tab switcher in Firefox or Chrome is not working well for all websites. I am trying to create a virtual desktop switcher to open a new process window (browser specific to the website displayed) in different virtual desktops on Windows 10. I found a PowerShell command set to create the virtual desktops and think I have an infinite loop setup for the switching between the desktops while waiting a specified time between them.
How do I open the process in the specific desktop? I didn't want to try to move the process because I may need to open more than one Firefox browser, for instance, and figured it would just pull all the Firefox processes to the same desktop which defeats the purpose.
Link to VirtualDesktop.ps1: https://gallery.technet.microsoft.com/scriptcenter/Powershell-commands-to-d0e79cc5
The script so far:
# Change to VirtualDesktop powershell folder
cd C:\Users\monitor1\Downloads\VirtualDesktop
Load commands (assumes VirtualDesktop.ps1 is in the current path)
. .\VirtualDesktop.ps1
Create a new virtual desktop and switch to it
New-Desktop | Switch-Desktop
$path = "C:\Program Files\Mozilla Firefox\firefox.exe"
Start-Process $path -ArgumentList 'https://system.url.com'
Create a new virtual desktop
New-Desktop | Switch-Desktop
$path = "C:\Program Files\Google\Chrome\Application\chrome.exe"
Start-Process $path -ArgumentList 'http://solarwinds.url.com'
#switch between desktops with a 30 second pause
$VD = 1
while ($VD = 1) {
$DesktopList = @(1..2)
foreach ($DesktopNum in $DesktopList) {
Switch-Desktop -Desktop $DesktopNum
Start-Sleep -s 30
}
}